Image Dropdown
An image dropdown enlarges the image when hovered over, providing a zoom effect. This requires basic CSS to control the display and hover state.
Example: Image Dropdown
<!DOCTYPE html>
<html>
<head>
<title>Image Dropdown</title>
<style>
.dropmenu {
position: relative;
display: inline-block;
margin-left: 150px;
}
.sub-dropmenu {
display: none;
position: absolute;
}
.dropmenu:hover .sub-dropmenu {
display: block;
}
.enlarge {
padding: 15px;
text-align: center;
}
.gfg {
margin-left: 40px;
font-size: 30px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="gfg">Image Dropdown property</div>
<div class="dropmenu">
<img src=
"https://media.w3wiki.org/wp-content/uploads/temp1.png"
width="150"
height="50" align="middle">
<div class="sub-dropmenu">
<img src=
"https://media.w3wiki.org/wp-content/uploads/temp1.png"
width="600"
height="200">
</div>
</div>
</body>
</html>
Output:
CSS DropDowns
Dropdowns are a crucial component of interactive websites, allowing users to access multiple links from a single menu. Using CSS, you can design stylish and functional drop-down menus. In HTML, a dropdown typically consists of a nested list within an unordered list (<ul>), utilizing list (<li>) tags to create the dropdown structure. CSS properties bring these elements to life, making the dropdown interactive and visually appealing.