How can I change the background of a parent <div>
when an <input>
or <a>
is :focus'd (or any other dynamic pseudo-class?
Eg
<div id="formspace">
<form>
<label for="question">
How do I select #formspace for the case when a child is active?</label>
<input type="text" id="question" name="answer"/></form></div>
:focus
-- only parent selectors. There is a new:focus-within
pseudo selector with some browser support which would satisfy the OP's question here but would not correctly answer the linked "duplicate" question. Can we have this question unmarked as a duplicate or have a more accurate duplicate question linked? @Paulie_D @kapa