PDA

View Full Version : CSS question


LD
2011-02-09, 12:10 PM
I think I have seen this, but I can't figure out how to do it (assuming it's possible).

I want to make a div change backgrounds using 'hover'. I can make the linked text within the div do it, but I want the entire div to change. Can that be done?

cd34
2011-02-09, 01:11 PM
<style>
.hoverme { background: #ccc; width: 300px; height: 100px;}
.hoverme:hover { background: #f33; }
</style>
<div class="hoverme">test
test
<a href="http://google.com/">Google</a>
test
</div>


It is the same as doing an <a> tag, you just apply the hover styling to the block you want.

LD
2011-02-09, 02:57 PM
<style>
.hoverme { background: #ccc; width: 300px; height: 100px;}
.hoverme:hover { background: #f33; }
</style>
<div class="hoverme">test
test
<a href="http://google.com/">Google</a>
test
</div>


It is the same as doing an <a> tag, you just apply the hover styling to the block you want.

YES perfect. (I was very close |angry| )