DROPDOWN:-
A drop-down menu is a graphical control element, similar to a list box, that allows the user to choose one value from a list. When a drop-down list is inactive, it displays a single value. When activated, it displays (drops down) a list of values, from which the user may select one.
EXAMPLE:-
<html>
<head>
<style>
.dropdown1 {
position: relative;
display: inline-block;
}
.dropdown1-content {
display: none;
position: absolute;
background-color: lightgrey;
min-width: 160px;
box-shadow: 0px 8px 16px 0px
rgba(0,0,0,0.2);
padding: 12px 16px;
}
.dropdown1:hover .dropdown1-content {
display: block;
}
.dropbtn {
background-color: steelblue;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}
.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);
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover
{background-color: #f1f1f1}
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-color: turquoise;
}
</style>
</head>
<body>
<h2>Dropdown Menu</h2>
<p>Move the mouse over the button to
open the dropdown menu.</p>
<div class="dropdown">
<button class="dropbtn">Dropdown
</button>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div>
<h2>Hoverable Dropdown</h2>
<p>Move the mouse over the text
below to open the dropdown
content.</p>
<div class="dropdown1">
<span>Mouse over me</span>
<div class="dropdown1-content">
<p>Hoverable Dropdown</p>
</div>
</div>
</body>
</html>
OUTPUT:-
![]() |
| sk.1 |
![]() |
| sk.2 |


No comments:
Post a Comment