Skip to content

Instantly share code, notes, and snippets.

@andimariadi
Created July 6, 2017 00:20
Show Gist options
  • Save andimariadi/aed54071599fc3db530a2f72237f925b to your computer and use it in GitHub Desktop.
Save andimariadi/aed54071599fc3db530a2f72237f925b to your computer and use it in GitHub Desktop.
Kode lengkap styles.css cara membuat dropdown dengan html
nav a:hover {
text-decoration: none;
}
nav ul {
list-style: none;
}
nav ul li {
float: left;
padding: 5px 20px;
}
nav ul li:hover {
background-color: #2980b9;
}
nav ul li ul {
display: none;
list-style: none;
margin-left: -20px;
}
nav ul li ul li {
float: none;
padding: 5px 20px;
margin-left: -40px;
}
nav ul li ul li:hover {
background-color: #2980b9;
}
nav ul li:hover > ul {
display: block;
position: absolute;
background: #ddd;
}
nav ul li:hover > a {
color: #fff;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment