Skip to content

Instantly share code, notes, and snippets.

@hugofabricio
Created November 16, 2013 21:16
Show Gist options
  • Select an option

  • Save hugofabricio/7505429 to your computer and use it in GitHub Desktop.

Select an option

Save hugofabricio/7505429 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="utf-8" />
<title>Curso CSS</title>
<style type="text/css">
ul {
padding: 0;
margin: 0;
list-style: nome;
}
li {
border: 1px solid black;
width: 120px;
padding: 3px;
position: relative;
}
li:hover {
background-color: black;
color: white;
cursor: pointer;
}
li > ul {
position: absolute;
left: 126px;
top: -1px;
color: black;
}
</style>
<script type="text/javascript" src="js/jquery-1.10.2.min"></script>
<script type="text/javascript">
$(document).ready(function()) {
$("#menu li ul").hide();
$("#menu li a").houver(
function(){$(this).children("ul").show();},
function(){$(this).children("ul").hide();},
);
}
</script>
</head>
<body>
<ul id="menu">
<li>Menu 1</li>
<li><a href="#">Menu 2</a>
<ul>
<li>Sub menu 2.1</li>
<li><a href="#">Sub menu 2.2</a>
<ul>
<li>Sub menu 2.2.1</li>
<li>Sub menu 2.2.2</li>
</ul>
</li>
<li>Sub menu 2.3</li>
</ul>
</li>
<li>Menu 3</li>
<li>Menu 4</li>
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment