<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Centered Inline Horizontal Dropdown</title>
<meta name="generator" content="PSPad editor, www.pspad.com">
<style type="text/css">
#nav{
position: relative; /* sets the mainlist as a reference for the sublist */
margin: 0; /* reset the default left margin in IE */
padding: 0; /* reset the default left padding in good browsers */
width: 100%;
height: 2.4em;
font: 900 68%/2.4 verdana; /* line-height same as the ul height to center the text, (default is ~ 1.2 times the font-size) */
text-align: center; /* center all inlines */
background: #010066;
}
#nav ul{
position: absolute; /* position the subnav according to nearest positioned ancestor (here the main ul) */
top: 1.7em; /* IE to not drop hover, ul starts close below the text */
left: 0;
margin-left: -9999px; /* hide the subnav */
border-top: .7em solid #010066; /* IE to not drop hover, the intended gap between text and sublist is covered with a border */
padding: 0; /* reset the default left padding in good browsers */
width: 100%;
height: 2.4em;
background: #91ad47;
}
#nav li:hover ul,
#nav li.sfhover ul{ /* IE6 hover faked by the class sfhover */
margin: 0; /* show the subnav */
}
#nav li{
display: inline; /* line up the items within the list width */
padding: 0 2em; /* only side padding/margin applies on inlines */
}
#nav a{
color: #9bcdff;
text-decoration: none;
text-transform: uppercase;
}
#nav li:hover a, /* all links on hover */
#nav li.sfhover a{ /* IE6 fake hover */
color: #0133ff;
}
#nav ul a:hover{ /* sublist links on hover, same specificity overrides the before rule */
color: #04016a;
}
</style>
<!--[if lte IE 6]>
<script type="text/javascript">// the Suckerfish script inserts class=sfhover on all li inside id=nav on mouseover
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
</script>
<![endif]-->
</head><body>
<ul id="nav">
<li><a href="#">panels & parties</a></li>
<li><a href="#">venues</a>
<ul>
<li><a href="#">closing night</a></li>
<li><a href="#">tickets</a></li>
<li><a href="#">passes</a></li>
</ul>
</li>
<li><a href="#">media</a></li>
<li><a href="#">faq</a></li>
<li><a href="#">sponsors</a></li>
</ul>
</body></html>
Bookmarks