Is there a way to apply a style to the parent element when an input is in focus?
input:focus
{
background-color:yellow;
}
For example, if we have the following HTML:
<div class="foo">
<input type="text />
Hello
</div>
Is it possible to change the style of the "foo" div when the input field is focused?
edit: This question may be related to Affecting parent element of :focus'd element (pure CSS+HTML preferred)
Could someone provide an explanation on how this can be achieved?