Skip to main content
Post Closed as "Duplicate" by Ciro Santilli OurBigBook.com, Paulie_D, kapa css
added 18 characters in body
Source Link
Shane Daniel
  • 959
  • 1
  • 7
  • 14

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

`

How do I select #formspace for the case when a child is active? `
<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>

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

`

How do I select #formspace for the case when a child is active? `

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>
Source Link
Shane Daniel
  • 959
  • 1
  • 7
  • 14

Affecting parent element of :focus'd element (pure CSS+HTML preferred)

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

`

How do I select #formspace for the case when a child is active? `