<h3>Adjacent Sibling Selector</h3>
<ol>
<li id="one"> One </li>
<li> Two </li>
<li> Three </li>
<li> Four </li>
<li> Five </li>
</ol>
<h3>General Sibling Selector</h3>
<ul>
<li id="first"> One </li>
<li> Two </li>
<li> Three </li>
<li> Four </li>
<li> Five </li>
</ul>
#one + li {
background-color: red;
}
#first ~ li {
background-color: green;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.