tests/Webdev/dropdown.html
2024-03-10 16:02:52 +01:00

51 lines
1021 B
HTML

<!DOCTYPE html>
<html>
<head>
<style>
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown input[type="checkbox"] {
display: none;
}
.dropdown input[type="checkbox"]:checked + .dropdown-content {
display: block;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {
background-color: #f1f1f1;
}
</style>
</head>
<body>
<div class="dropdown">
<label for="dropdown-toggle">Dropdown</label>
<input type="checkbox" id="dropdown-toggle">
<div class="dropdown-content">
<a href="#">Option 1</a>
<a href="#">Option 2</a>
<a href="#">Option 3</a>
</div>
</div>
</body>
</html>