Skip to content

Instantly share code, notes, and snippets.

@jdzcn
Created February 23, 2021 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdzcn/a32d022f3e96ff2e364ec58f4f81c3fe to your computer and use it in GitHub Desktop.
Save jdzcn/a32d022f3e96ff2e364ec58f4f81c3fe to your computer and use it in GitHub Desktop.
css:dropmenu
.dropdown {
position: relative;
display: inline-block;
float:right;
cursor:pointer;
}
.dropdown-content {
display: none;
position: absolute;
right: 0;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}
.dropdown-content a {
color: black;
font-size:1em;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {
background-color: gray;
color:white;}
.dropdown:hover .dropdown-content {
display: block;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment