Skip to content

Instantly share code, notes, and snippets.

@jwdunne
Created June 28, 2011 19:54
Show Gist options
  • Save jwdunne/1052029 to your computer and use it in GitHub Desktop.
Save jwdunne/1052029 to your computer and use it in GitHub Desktop.
CSS Dropdowns
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>test</title>
<style type="text/css" media="screen">
.subnav {
padding-left: 0;
margin-left: 0;
}
.nav, .subnav {
list-style-type: none;
}
.nav li {
float: left;
width: 100px;
background-color: #eee;
padding: 3px;
}
.nav .subnav {
display: none;
}
.nav li:hover .subnav {
display: block;
}
.subnav li:hover {
background-color: #ddd;
}
</style>
</head>
<body id="test" onload="">
<ul class="nav">
<li>A</li>
<li>B
<ul class="subnav">
<li>A</li>
<li>B</li>
<li>B</li>
<li>D</li>
<li>E</li>
</ul>
</li>
<li>C
<ul class="subnav">
<li>A</li>
<li>B</li>
<li>B</li>
<li>D</li>
<li>E</li>
</ul>
</li>
<li>D</li>
<li>E</li>
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment