Hi, I'm currently trying to recode the navigation portions of my company's site from javascript to CSS, but I'm not allowed to alter the design very much...I have managed to code both menus on the page into CSS, you can see it here http://www.ea-inc.com/Testing/index.shtml.
It seems to work fine in Firefox but when it's in IE, the sub menu for the horizontal drop-down menu offsets to the right, and layers under the other vertical menu. I've tried it on its own and it has the same effect in IE 7. Tried everything I could think of already but still it's like this. If anyone can give me some help, it would be appreciated greatly!
#menu li { /* make the list elements a containing block for the nested lists */ position: relative; }
#menu ul ul { position: absolute; top: 0; left: 100%; /* to position them to the right of their containing block */ width: 18em; /* width is based on the containing block */ }
#menu ul ul ul { position: absolute; top: 0; left: 100%; /* to position them to the right of their containing block */ width: 19em; /* width is based on the containing block */ }
div#menu ul ul, div#menu ul li:hover ul ul {display:none;}
div#menu ul li:hover ul, div#menu ul ul li:hover ul {display: block;}
div#menu ul ul ul, div#menu ul ul li:hover ul ul {display: none;}
div#menu ul ul li:hover ul, div#menu ul ul ul li:hover ul {display: block;}
/*#menu ul li { float:left; /* cure IE5.x \"whitespace in lists\" problem width: 100%; }*/ #menu ul li a { height: 1%; /* make links honour display: block; properly */ } </style> <![endif]-->
I haven't got a web developer bar for ie on my test machine (normally use a mac) but it looks to me that ie is applying margin to your list items, you have margin:0; padding:0; on your ul but not your li, perhaps give that a go.... #menu ul li {margin:0; padding:0;}
I see the problem you're having, but honestly have nary a clue as to why it's happening. I feel like I just had a problem like this but I can't quite put my finger on it.
As a side note:
You should really be structuring the nave like this:
http://www.ea-inc.com/Testing/index.shtml.
It seems to work fine in Firefox but when it's in IE, the sub menu for the horizontal drop-down menu offsets to the right, and layers under the other vertical menu. I've tried it on its own and it has the same effect in IE 7. Tried everything I could think of already but still it's like this. If anyone can give me some help, it would be appreciated greatly!
this is the code for the horizontal drop down..
and this is for the vertical one, just in case it's needed...
This is the change made to the horizontal menu that solved the overlapping issue
I'll have a look when I get in to work in the morning if noone else nabs this by then.
#menu ul li {margin:0; padding:0;}
Hope that helps
As a side note:
You should really be structuring the nave like this: