I am trying to hover over a parent div to change the background-color of that div, but I feel like the children are getting in the way. Here is a basic example of the code I am using:
I want to be able to hover over test and have both divs turn tan or red.Code:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <style type="text/css"> .a1{clear:left;width:95%;} .a1:hover{background-color:tan;} .a2{float:left;padding-left:5px;width:30%;} .a2:hover{background-color:red;} </style> <div class='a1'><div class='a2'>test</div><div class='a2'>test</div></div> </HTML>
any ideas?



Reply With Quote
Bookmarks