Looking at it with Firebug, I see it's getting a width of 100% from #menu ul ul li but I don't know why it's wider than the other subitems. Thanks for any suggestions.
Here's my stylesheet:
Code: Select all
/* Main menu settings */
#menu {
clear:both;
float:left;
margin:0;
padding:0;
border-bottom:1px solid #000; /* black line below menu */
width:100%;
font-family:Arial, Helvetica, sans-serif; /* Menu font */
font-size:16px; /* Menu text size */
z-index:1000; /* This makes the dropdown menus appear above the page content below */
position:relative;
}
/* Top menu items */
#menu ul {
margin:0;
padding:0;
list-style:none;
float:right;
position:relative;
right:50%;
}
#menu ul li {
float:left;
position:relative;
left:50%;
top:1px;
}
#menu ul li a, .currentpage {
display:block;
margin:0;
padding:.6em .5em .4em;
font-size:1em;
line-height:1em;
background:#FFF;
text-decoration:none;
color:#444;
font-weight:bold;
border-bottom:1px solid #000;
}
#menu ul li.menuactive a {
color:#000;
background:#FFF;
}
#menu ul li a:hover {
background:#FFF; /* Top menu items background colour */
color:#fff;
}
#menu ul li:hover a,
#menu ul li.hover a { /* This line is required for IE 6 and below */
background:#FFF; /* Top menu items background colour */
color:#000;
}
/* Submenu items */
#menu ul ul {
display:none; /* Sub menus are hiden by default */
position:absolute;
top:2em;
left:0;
right:auto; /*resets the right:50% on the parent ul */
width:10em; /* width of the drop-down menus */
}
#menu ul ul li {
left:auto; /*resets the left:50% on the parent li */
margin:0; /* Reset the 1px margin from the top menu */
clear:left;
width:100%;
}
#menu ul ul li a,
#menu ul li.menuactive li a,
#menu ul li:hover ul li a,
#menu ul li.hover ul li a { /* This line is required for IE 6 and below */
font-size:.8em;
font-weight:normal; /* resets the bold set for the top level menu items */
background:#eee;
color:#444;
line-height:1.4em; /* overwrite line-height value from top menu */
border-bottom:1px solid #ddd; /* sub menu item horizontal lines */
}
#menu ul ul li.currentpage {
font-size:.8em;
font-weight:normal; /* resets the bold set for the top level menu items */
background:#eee;
color:#444;
line-height:1.4em; /* overwrite line-height value from top menu */
border-bottom:1px solid #ddd; /* sub menu item horizontal lines */
}
#menu ul ul li a:hover,
#menu ul li.menuactive ul li a:hover,
#menu ul li:hover ul li a:hover,
#menu ul li.hover ul li a:hover { /* This line is required for IE 6 and below */
background:#FFF; /* Sub menu items background colour */
color:#000;
}
/* Flip the last submenu so it stays within the page */
#menu ul ul.last {
left:auto; /* reset left:0; value */
right:0; /* Set right value instead */
}
/* Make the sub menus appear on hover */
#menu ul li:hover ul,
#menu ul li.hover ul { /* This line is required for IE 6 and below */
display:block; /* Show the sub menus */
}