In this HTML code, I opted to use images as dropdown elements instead of traditional buttons or text.
/* Dropdown Button / .dropbtn { background-image: url(Images/Buttons/Resources3.png); width: 110px; height: 40px; } / 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;
min-width: 110px;
z-index: 1;
color: black;
padding: 0px;
text-decoration: none;
display: block;
}
/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
display: block;
}
.dropdown:hover .dropbtn {
background-image: url(Images/Buttons/Resources3R.png);
}
<div class="dropdown">
<img class="dropbtn">
<div class="dropdown-content">
<img src="../Images/Buttons/Aboutus1.png" width="110px" height="40px">
<img src="../Images/Buttons/Aboutus2.png" width="110px" height="40px">
<img src="../Images/Buttons/Aboutus3.png" width="110px" height="40px">
</div>
</div>