Kevin Powell - CommunityKP-C
Kevin Powell - Community3y ago
23 replies
JRev3

Style elements between two headings

I would like to use CSS to select elements that come after h5 headings. However, I do not want to target the elements if their more recent sibling is an h4. Is there a way to use general sibling selectors and specificity to achieve this?

Here is an example: https://codepen.io/Jimmy-Revelino/pen/PoxmNQr

JS would also be an option, if that opened up possibilities.
Was this page helpful?