With regard to the following markup:
<div class="mydiv">
<a href="index.php"><img src="myimage.gif" /></a>
</div>
The div.mydiv is basically styled to be a pretty rounded edge box around the image specified within the link. Lets say its background-color starts as black.
I would like to make it so that when I :hover over myimage.gif, the style of div.mydiv changes the background-color to, lets say, yellow.
How can I specify the style of div.mydiv when a nested <a> is being hovered over?
Use
.mydiv:hover{
background-color:yellow;
}
in a CSS file, assuming you have one. I don’t think there’s a way to do this inline.