I know that:
p+p
changes the style of the first p just after another p. But how can I change the css of the second p after a p ?
I know that:
p+p
changes the style of the first p just after another p. But how can I change the css of the second p after a p ?
Simply add another +p
:
p+p+p
If you have more than three p
elements, this applies to the second one that comes after the first, as well as all subsequent elements. If you only want to apply to one p
element, use:
p:first-child+p+p
Or if you can afford to ignore older browsers:
p:nth-child(3)