Using the Adjacent Sibling Combinator
To change the style of a paragraph that immediately follows a heading, you can use the adjacent sibling combinator (+). This targets only the first element directly after the specified element.
Syntax: h1 + p selects the first <p> that immediately follows an <h1>.
Only the next sibling is targeted; other paragraphs or siblings are not affected.
Useful for styling content that follows headings consistently without adding extra classes.
0-2 years experience
2-5 years experience
5-8 years experience
8+ years experience