...

View Full Version : Drop down menu not working in IE7



bryan868
06-18-2010, 06:28 PM
Greetings, I wrote from scratch this centered horizontal drop down menu with centered horizontal sub menu. It's working everywhere except for IE7. Any idea why?

http://bryanharley.com/test.html


I thought I might have narrowed it down to this:


.nav ul li:hover ul{
position: absolute;
display: block;
}

That piece makes the subnav appear. It formats correctly everywhere except in IE7. In IE7 the subnav just lines up along the top nav element instead of appearing below it. If I change it to:


.nav ul li:hover ul{
position: absolute;
display: inline;
}

Then it replicates the incorrect formatting in all browsers. So does this mean IE7 doesn't understand display:block; or it's showing it as display:inline;? Why? Or am I wrong? How can I fix this?

Someone else suggested position:absolute; might be the problem, but if I change it to position:relative; then the whole thing goes wonky, see:
http://bryanharley.com/test2.html

bryan868
06-18-2010, 07:19 PM
Alternatively, I tried using left:-999%; and left:auto; to hide and show the second level UL, but that's producing the same results in IE7. You can see that here: http://www.bryanharley.com/test1.html.

bryan868
06-18-2010, 07:46 PM
Nevermind! Got it!

Added position relative to .nav ul. Replaced margin-top and margin-left with top and left on .nav ul li ul.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum