I know that I can style the focused input element as follows:
input:focus { background-color:yellow; }
But is it possible to set the style in the parent when the focus is in the input? eg.
<div class="foo"> <input type="text /> Hello </div>
Can I influence the foo style when there is focus?
edit: Possible duplicate Effect on parent: focus'd (preferred CSS + HTML)
However, can someone explain how this works?
source share