@forthright48/simplecss
Version:
A simple css library using flexbox for layout
42 lines (35 loc) • 1.01 kB
CSS
/* Dropdown
–––––––––––––––––––––––––––––––––––––––––––––––––– */
/* Style The Dropdown Button */
.dropbtn {
padding: 1.6rem;
cursor: pointer;
}
/* The container <div> - needed to position the dropdown content */
.dropdown {
position: relative;
display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 200%;
white-space: nowrap;
box-shadow: 0rem 0.8rem 1.6rem 0rem rgba(0,0,0,0.2);
}
/* Links inside the dropdown */
.dropdown-content a {
padding: 1.2rem 1.6rem;
text-decoration: none;
display: block;
}
/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
display: block;
}
/* Change the background color of the dropdown button when the dropdown content is shown */
.dropdown:hover .dropbtn {
background-color: mistyrose;
}