Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Style elements between two headings - Kevin Powell - Community
KP-C
Kevin Powell - Community
•
3y 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
.
CodePen
Jimmy Revelino
Select Elements
.
.
.
Kevin Powell - Community
Join
A friendly place for developers to meet other devs, ask questions, get help, and just have a good time 🙂.
36,263
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Consistent distances between two elements in a grid
KP-C
Kevin Powell - Community / front-end
2y ago
Prettier is removing space between two jsx elements
KP-C
Kevin Powell - Community / front-end
3y ago