Pure CSS drop-down menu
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title></title>
<style rel="stylesheet" type="text/css">
/* begin Menu */
/* menu structure */
.menu a, .menu a:link, .menu a:visited, .menu a:hover
{
text-align:left;
text-decoration:none;
outline:none;
letter-spacing:normal;
word-spacing:normal;
}
.menu, .menu ul
{
margin: 0;
padding: 0;
border: 0;
list-style-type: none;
display: block;
}
.menu li
{
margin: 0;
padding: 0;
border: 0;
display: block;
float: left;
position: relative;
z-index: 5;
background:none;
}
.menu li:hover
{
z-index: 10000;
white-space: normal;
}
.menu li li
{
float: none;
}
.menu ul
{
visibility: hidden;
position: absolute;
z-index: 10;
left: 0;
top: 0;
background:none;
}
.menu li:hover>ul
{
visibility: visible;
top: 100%;
}
.menu li li:hover>ul
{
top: 0;
left: 100%;
}
.menu:after, .menu ul:after
{
content: ".";
height: 0;
display: block;
visibility: hidden;
overflow: hidden;
clear: both;
}
.menu, .menu ul
{
min-height: 0;
}
.menu ul
{
padding: 10px 30px 30px 30px;
margin: -10px 0 0 -30px;
}
.menu ul ul
{
padding: 30px 30px 30px 10px;
margin: -30px 0 0 -10px;
}
/* menu structure */
.menu
{
padding: 3px 3px 3px 3px;
}
.nav
{
position: relative;
height: 33px;
z-index: 100;
}
.nav .l, .nav .r
{
position: absolute;
z-index: -1;
top: 0;
height: 33px;
}
.nav .l
{
left: 0;
right:0px;
}
.nav .r
{
right: 0;
width: 880px;
clip: rect(auto, auto, auto, 880px);
}
/* end Menu */
/* begin MenuItem */
.menu ul li
{
clear: both;
}
.menu a
{
position:relative;
display: block;
overflow:hidden;
height: 27px;
cursor: pointer;
text-decoration: none;
margin-right: 3px;
margin-left: 3px;
}
.menu a .r, .menu a .l
{
position:absolute;
display: block;
height: 81px;
}
.menu a .l
{
left:0;
right:1px;
}
.menu a .r
{
width:402px;
right:0;
clip: rect(auto, auto, auto, 401px);
}
.menu a .t
{
font-family: Tahoma, Arial, Helvetica, Sans-Serif;
font-size: 13px;
font-style: normal;
font-weight: bold;
letter-spacing: 1px;
text-transform: uppercase;
color: #EAECBB;
padding: 0 22px;
margin: 0 1px;
line-height: 27px;
text-align: center;
}
.menu a:hover .l, .menu a:hover .r
{
top:-27px;
}
.menu li:hover>a .l, .menu li:hover>a .r
{
top:-27px;
}
.menu li:hover a .l, .menu li:hover a .r
{
top:-27px;
}
.menu a:hover .t
{
color: red;
}
.menu li:hover a .t
{
color: red;
}
.menu li:hover>a .t
{
color: red;
}
.menu a.active .l, .menu a.active .r
{
top: -54px;
}
.menu a.active .t
{
color: #E7E7DE;
}
/* end MenuItem */
/* begin MenuSeparator */
.nav .separator
{
display: block;
width: 1px;
height: 27px;
}
/* end MenuSeparator */
/* begin MenuSubItem */
.menu ul a
{
display:block;
text-align: center;
white-space: nowrap;
height: 32px;
width: 180px;
overflow:hidden;
line-height: 32px;
margin-right: auto;
background-position: left top;
background-repeat: repeat-x;
border-width: 1px;
border-style: solid;
border-color: #C5C940;
}
.nav ul.menu ul span, .nav ul.menu ul span span
{
display: inline;
float: none;
margin: inherit;
padding: inherit;
text-align: inherit;
text-decoration: inherit;
}
.menu ul a, .menu ul a:link, .menu ul a:visited, .menu ul a:hover, .menu ul a:active, .nav ul.menu ul span, .nav ul.menu ul span span
{
text-align: left;
text-indent: 12px;
text-decoration: none;
line-height: 32px;
color: #595B1A;
font-family: Tahoma, Arial, Helvetica, Sans-Serif;
font-size: 13px;
letter-spacing: 1px;
}
.menu ul ul a
{
margin-left: auto;
}
.menu ul li a:hover
{
color: #3B4616;
border-color: #C5C940;
background-position: 0 -32px;
}
.menu ul li:hover>a
{
color: #3B4616;
border-color: #C5C940;
background-position: 0 -32px;
}
.nav .menu ul li a:hover span, .nav .menu ul li a:hover span span
{
color: #3B4616;
}
.nav .menu ul li:hover>a span, .nav .menu ul li:hover>a span span
{
color: #3B4616;
}
/* end MenuSubItem */
</style>
</head>
<body>
<div class="nav">
<div class="l"></div>
<div class="r"></div>
<ul class="menu">
<li><a href="#" class=" active"><span class="l"></span><span class="r"></span><span class="t">Home</span></a></li>
<li><a href="#"><span class="l"></span><span class="r"></span><span class="t">About</span></a>
<ul>
<li><a href="#">Photos</a></li>
<li><a href="#">Press</a></li>
</ul>
</li>
<li><a href="#"><span class="l"></span><span class="r"></span><span class="t">Services</span></a></li>
<li><a href="#"><span class="l"></span><span class="r"></span><span class="t">Solutions</span></a>
<ul>
<li><a href="#">Consulting</a>
<ul>
<li><a href="#">Lorem ipsum</a> </li>
<li><a href="#">Dolor sit amet</a> </li>
<li><a href="#">Consectetuer</a> </li>
</ul>
</li>
<li><a href="#">Training</a></li>
<li><a href="#">Analysis</a></li>
</ul>
</li>
<li><a href="#"><span class="l"></span><span class="r"></span><span class="t">Contact</span></a></li>
</ul>
</div>
</body>
</html>
Related examples in the same category