Lessons, tips, and experiences from venturing through the realms of technology and software.

Saturday, June 6, 2009

CSS Drop Down Hover Not Working in IE 6 and Older

Internet Explorer 6 and older does not have a :hover capability implemented for the CSS li tag, thus li:hover will not work for drop down menus when using IE browsers older than version 7.

The work-around for this involves using a script in order to be able to use and style li:hover and other hover-related elements.

In order to do so, you need to download this .htc file, which contains the script.

After doing so, add the behavior attribute with the URL location of the .htc file inside the body of your .css file.


body {
behavior:url("/csshover3.htc");
}


Once completed, your dropdown menu should now be able to hover and "drop down" in IE.


No comments:

This site is a Coconuter production