Tsallaka zuwa abun ciki
Justice Tech School

Sibling Selectors

+ selects the element right after another. ~ selects all following siblings. They are handy for form hints and menus.

Example
<style>
h3 + p { color: #5eead4 } h3 ~ p { border-left: 3px solid #f59e0b; padding-left: 6px }
</style>
<h3>Title</h3><p>First after</p><p>Second after</p>

Exercise

Next sibling symbol.

h3  p

Quiz Test

Which selects all later siblings?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.