Finished a kick ass assignment, checked it on all available browsers on my mac, all good, so I submitted.

Then I was over my misses mate's house and looked at it on windows and there are menu hover issues in Explorer. I have been looking and looking but I can't seem to find a clear fix.

Anyone know non-javascript way to fix this?

Here is the html and css snippets -

<div id="nav">
        <li class="first"><a href="index.html">Home</a></li>
        <li><a href="trainer/aboutus.html">About Us</a></li>
        <li><a href="trainer/psychology.html">Psychology</a>
            <li><a href="trainer/new_to_gym.html">New to Gym?</a></li>
            <li><a href="trainer/committed.html">Are you Committed?</a></li>
            <li><a href="trainer/fad.html">Just a Fad?</a></li>
            <li><a href="trainer/scared.html">But the gym seems a bit scary!</a></li>	    
        <li><a href="trainer/faqs.html">FAQ's</a>
            <li><a href="trainer/muscle_to_fat.html">Muscle turning to Fat?</a></li>
            <li><a href="trainer/big.html">I don't want to be big!</a></li>
            <li><a href="trainer/crunches.html">Crunches for Abs?</a></li>
            <li><a href="trainer/weights.html">Why weights?</a></li>
        <li><a href="trainer/programming.html">Programming</a>
            <li><a href="trainer/contraction_basics.html">Contraction Basics</a></li>
            <li><a href="trainer/program_basics.html">Program Basics</a></li>
            <li><a href="trainer/how_to_progress.html">How to make progress</a></li>
            <li><a href="trainer/links.html">Links for Advanced Trainees</a></li> 
        <li><a href="trainer/contact.html">Contact Us</a></li>
    </div> <!-- end #nav -->

*{ margin:0px; padding: 0px; }

#nav {
	font-family: arial, sans-serif;
	position: relative;
	width: 798px;
	margin: 0 auto;
	border-bottom: 1px solid #f2f2f2; /*top white border here*/
	border-top: 1px solid #f2f2f2; /*bottom white border here*/

#nav ul {
	list-style-type: none;

#nav ul li {
	position: relative;

#nav ul li a {
	text-align: center;
	width: 117px;

#nav ul li a:hover {

#nav ul li ul {
	display: none;

#nav ul li:hover ul {
	display: block;
	position: absolute;
}/* drop down menu options */

#nav ul li:hover ul li a {
	width: 117px;
	text-align: center;
	border-bottom: 1px solid #f2f2f2;
	border-right: 1px solid #f2f2f2;
	border-left: 1px solid #f2f2f2;

#nav ul li:hover ul li a:hover {

Recommended Answers

All 3 Replies

IE 6 and older can't understand li:hover function. You need a script for this function. Here is js.

navHover = function() { 
var lis = document.getElementById("nav-menu").getElementsByTagName("LI");	
for (var i=0; i<lis.length; i++) {
lis[i].onmouseover=function() {
this.className+=" iehover";		}
lis[i].onmouseout=function() {			
this.className=this.className.replace(new RegExp(" iehover\\b"), "");		}	} }
if (window.attachEvent) window.attachEvent("onload", navHover);

You need to pay the unique id to your main ul tag. The script get the ul tag using DOM object. Here it is:


The text shown with red color is the id of the ul. And get this in your HTML head section.

<!-[if gte IE 6]>
<script type="text/javascript" src="ie.js"></script>

Good luck.

Thanks, I will try that out now.

I am also having issues in IE8. The menu pops down then when i go to mouse over it disappears. I can flicker the mouse quickly back and forth to kind of catch it. Why would this happen in IE8?


This is because you floated the li tags from parent ul. So, it force it all child li to float. So you need to break float for the child li tag. Here

#nav ul ul li {
       float: none

It would work. And puts doctype in your html.

commented: Thanks Man! Appreciated! +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.