In this JSFiddle example, using CSS only, can the .child
element be targeted/styled when the .secondChild
element gets the attribute focused="true"
? Something like:
.grandParent [focused="true"] ...?
Here's my HTML:
<div class="grandParent">
<div class="parent">
<div class="child"></div>
</div>
<div class="parent sibling">
<textarea class="secondChild"></textarea>
</div>
</div>
And my current CSS:
.grandParent {
padding: 20px;
background: red;
}
.parent {
padding: 20px;
background: blue
}
.child {
padding: 20px;
background: green;
}
.secondChild {
padding: 20px;
background: grey;
}
.sibling {
padding: 20px;
background: orange;
}