PDA

View Full Version : Stupid CSS menu!!



Masetek
08-03-2006, 09:39 PM
I've just installed a new css menu on my site, and as expected everything works perfect in FF and not in IE.

Check it out in both browsers, my site (http://www.muscleandstrength.com)

In IE, when you mouseover a menu button that has a sub menu a huge gap appears under it, when you mouseout it goes. This is just damn annoying and it only happens in IE.

Here's the code:


/*
Vertical Menu ------------------------------------------------------------------ */

ul.makeMenu, ul.makeMenu ul {
width: 135px; /* sets the size of the menu blocks */
background-color: #f26522; /* makes the menu blocks mint green - a bg-color MUST be included for IE to work properly! */
padding-left: 0px; /* stops the usual indent from ul */
margin-left: 0px; /* Opera 7 final's margin and margin-box model cause problems */
}

ul.makeMenu ul {
border: 1px solid #000;
border-bottom: 0px;
}

ul.makeMenu li {
list-style-type: none; /* removes the bullet points */

margin:0px; /* Opera 7 puts large spacings between li elements */
padding:0px;
border:0px;
position: relative; /* makes the menu blocks be positioned relative to their parent menu item
the lack of offset makes these appear normal, but it will make a difference
to the absolutely positioned child blocks */
color: #fff; /* sets the default font colour to white */
}
ul.makeMenu li > ul { /* using the > selector prevents many lesser browsers (and IE - see below) hiding child ULs */
display: none; /* hides child menu blocks - one of the most important declarations */
position: absolute; /* make child blocks hover without leaving space for them */
top: -1px; /* position slightly lower than the parent menu item */
left: 135px; /* this must not be more than the width of the parent block, or the mouse will
have to move off the element to move between blocks, and the menu will close */
}

ul.makeMenu ul.CSStoShow { /* must not be combined with the next rule or IE gets confused */
display: block; /* specially to go with the className changes in the behaviour file */
}
ul.makeMenu li:hover > ul { /* one of the most important declarations - the browser must detect hovering over arbitrary elements
the > targets only the child ul, not any child uls of that child ul */
display: block; /* makes the child block visible - one of the most important declarations */
}

/* and some link styles */

ul.makeMenu li a:hover, ul.makeMenu li a.CSStoHighLink {
color: #000;
background-color: #f98c59;
text-decoration: none;
}

ul.makeMenu li:hover > a {
color: #000;
background-color: #f98c59;
text-decoration: none;
}

ul.makeMenu a {
padding: 0;
margin: 0;
padding-top: 5px;
padding-bottom: 5px;
text-align: center;
background-color: #f26522;
border: 0px;
border-bottom: 1px solid #000;
font-family: Verdana, arial, helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #fff;
text-decoration: none;
display: block;
width: 100%;
}

ul.makeMenu a:visited {
color: #fff;
text-decoration: none;
}

Anyone got any ideas?