Let's say i have the following code:
<div class="wrapper">
<div class="title"></div>
<div></div>
</div>
<div class="wrapper">
<div class="title"></div>
<div></div>
</div>
<div class="wrapper">
<div class="title"></div>
<div></div>
</div>
On hover for a wrapper I want it's child title div to change it's background color. Can I do this in pure css. In js I know how to do it. I'm interested if a pure CSS method exists for this?
Thanks
Yes, you can do this. It's just:
.wrapper:hover .title {
background-color: #f00;
}
EDIT:
Please note that IE6 recognizes :hover
only on a
-elements, so this won't work - but i hope you don't have to mess with that crappy old thing.
what about this?
.wrapper:hover .title {
background-color: blue;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With