Apply style to p tags directly after h1 tag until it hits another h tag?

Viewed 188

How can I apply a CSS style to all P tags directly after a H1 tag? But only until it hits another H1, H2 etc?

I have tried the following:

This only does the first P...

h1 + p {
  color:red
}

This does ALL P's after the H1 for the rest of the page...

h1 ~ p {
  color:red
}

This works but want something recurring...

h1 + p + p {
  color:red
}

JSFIDDLE: https://jsfiddle.net/wdmo5rhx/

1 Answers
Related