Forum Moderators: not2easy

Message Too Old, No Replies

navigation link, want entire block to change color during hover,

         

AffiliateDreamer

4:39 pm on Aug 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

During a hover on my main navigaiton links, I want the entire section surrounding the text to change background color, not just the text area.

What is the trick to get this too work?

Marshall

4:50 pm on Aug 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can add display: block; to the CSS of the link. The other option is add background-color: #whatever; to the hover function of the CSS and increase the padding surrounding the text. This may be better depending on how your navigation is set up as display: block; will throw off in-line displays.

Marshall

swa66

7:49 am on Aug 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It'll not work in IE6 without javascript as IE6 breaks CSS standards by not supporting :hover on anything but <a> tags.

supposing your html has a surrounding element with an id "nav":


#nav:hover {
background-color: red;
}

would do the trick.

To get IE6 on board: try the IE7.js script by Dean Edwards but the scrips do much more than just this so it's possible it'll have a much bigger impact.