Skip to content

Instantly share code, notes, and snippets.

@THEtheChad
Created April 4, 2012 16:38
Show Gist options
  • Save THEtheChad/2303649 to your computer and use it in GitHub Desktop.
Save THEtheChad/2303649 to your computer and use it in GitHub Desktop.
Basic menu styling.
<!doctype html>
<html>
<head>
<style>
.menu,
.submenu
{
list-style: none;
margin: 0;
padding: 0;
}
.submenu
{
display: none;
}
.menu li
{
position: relative;
}
.menu > li
{
float: left;
}
.menu a,
.menu > li:hover .submenu
{
display: block;
}
</style>
</head>
<body>
<ul class="menu">
<li><a href="#">Main 1</a></li>
<li>
<a href="#">Main 2</a>
<ul class="submenu">
<li><a href="#">Sub 1</a></li>
<li><a href="#">Sub 2</a></li>
</ul>
</li>
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment