<ul>
<li id="red">
<input value="Red">
</li>
<li id="blue">
<input value="Blue">
</li>
<li id="yellow">
<input value="Yellow">
</li>
</ul>
#red:focus-within {
background-color: red;
}
#blue:focus-within {
background-color: blue;
}
#yellow:focus-within {
background-color: yellow;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.