script type="text/javascript">
activateMenu = function(nav)
{
function hide(){
this.lastChild.style.display="none";
}
/* currentStyle restricts the Javascript to IE only */
if (document.all &&
document.getElementById(nav).currentStyle)
{
var navroot = document.getElementById(nav);
/* Get all the list items within the menu */
var lis=navroot.getElementsByTagName("LI");
for (i=0; i<lis.length; i++)
{
/* If the LI has another menu level */
if(lis[i].lastChild.tagName=="UL")
{
/* assign the function to the LI */
lis[i].onmouseover=function()
{
/* display the inner menu */
this.lastChild.style.display="block";
}
lis[i].onmouseout=function()
{
this.lastChild.style.display="none";
}
}
}
}
}
window.onload= function(){
/* pass the function the id of the top level UL */
/* remove one, when only using one menu */
activateMenu("nav");
activateMenu("vertnav");
}
</script>
#nav{list-style: none;}
#nav ul {
padding: 0;
margin:0;
list-style: none;
width:12em;
position:relative;
overflow:visible;
font-weight: bold;
text-align: center;
}
#nav li {
margin:0;
position: relative;
float:left;
width: 12em;
background-color:#99ccff;
border:solid 1px #ffffff;
display:block;
height:auto;
font-weight: bold;
text-align: center;
}
#nav ul li{ border-width:1px 1px 0 0px;}
#nav ul ul li{ border-width:1px 1px 0 0px;}
#nav ul ul li:last-child{border-bottom:1px solid #ffffff, margin-right:6em;}
#nav a {
text-decoration:none;
display:block;
padding: 0.1em;
margin:0.2em 0 0.2em 0.1em;
width:11.5em;
height:1em;
color:#000066;
}
#nav a:hover,
#nav li:hover{
background-color:#0099cc;
}
#nav ul li:hover,
#nav ul li a:hover{
background-color:#0099cc;
}
#nav ul{
display:none;
}
/*all see this */
#nav ul ul{
display:none;
position:absolute;
margin-top:-1.8em;
margin-left:6em;
z-index:100;
}
/* non-IE browsers see this */
#nav ul li>ul, #nav ul ul li>ul{
margin-top:-1.4em;
}
#nav li:hover ul ul,
#nav li:hover ul ul ul,
#nav li:hover ul ul ul ul,
#nav li:hover ul ul ul ul ul{
display:none;
}
#nav li:hover ul,
#nav ul li:hover ul,
#nav ul ul li:hover ul,
#nav ul ul ul li:hover ul,
#nav ul ul ul ul li:hover ul{
display:block;
}
li>ul {
top: auto;
left: auto;
}
#holdm{
position:absolute;
z-index:100;
width:100%;
}
Code:#nav{list-style: none;} #nav ul { padding: 0; margin:0; list-style: none; width:12em; position:relative; overflow:visible; font-weight: bold; text-align: center; } #nav li { margin:0; position: relative; float:left; width: 12em; background-color:#99ccff; border:solid 1px #ffffff; display:block; height:auto; font-weight: bold; text-align: center; } #nav ul li{ border-width:1px 1px 0 0px;} #nav ul ul li:last-child{border-bottom:1px solid #ffffff, margin-right:6em;} #nav a { text-decoration:none; display:block; padding: 0.1em; margin:0.2em 0 0.2em 0.1em; width:11.5em; height:1em; color:#000066; } /* I think this line can also be removed */ #nav a:hover, /* ^^^ this can be remove I believe ^^^ */ #nav li:hover{ background-color:#0099cc; } #nav ul{ display:none; } /*all see this */ #nav ul ul{ display:none; position:absolute; margin-top:-1.8em; margin-left:6em; z-index:100; } /* non-IE browsers see this */ #nav li>ul{ margin-top:-1.4em; } #nav li:hover > ul { display:block; } li>ul { top: auto; left: auto; } #holdm{ position:absolute; z-index:100; width:100%; }
#nav ul ul ul ul ul ul /* this is for 6 steps in... If you need less just remove ul's as needed */
{
left: -50px; /*whatever value */
}