I am facing a challenge in creating an HTML/CSS button that should display a dropdown when hovered over, but unfortunately, it's not working as expected.
Here is the link to the code.
.Panel {
overflow: hidden;
width: 25%;
height: 100%;
color: blue;
scrollbar-color: black lightgrey;
scrollbar-width: thin;
float: left;
}
.Panel a {
color: black;
white-space: pre;
text-decoration: none;
}
body {
overflow: hidden;
background: url(../Images/Texture.png) repeat 0 0;
}
.Document {
pointer-events: auto;
position: static;
padding-left: 26%;
width: 49%;
height: 100%;
}
.dropbtn {
padding: 16px;
font-size: 16px;
border: none;
background-image: url("../Images/dropdown.png");
background-size: 50px 28px;
background-repeat: no-repeat;
height: 28px;
width: 50px;
}
.Panel {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
overflow: auto;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropbtn:hover {
background-image: url("../Images/dropdown2.png");
background-size: 28px 50px;
background-repeat: no-repeat;
height: 50px;
width: 28px;
margin-left: 30px;
.dropdown-content {
display: block;
}
}
<div class="Panel">
<button class="dropbtn"></button>
<div id="myDropdown" class="dropdown-content">
<br> <br>
<a href="../" target="_self"> Home</a> <br>
<a href="" target="_self"> </a> <br>
<a href=”” target="_self"> </a> <br>
<a href="" target="_self"> </a> <br>
<a href="" target="_self"> </a> <br>
<a href="" target="_self"> </a> <br>
<a href="" target="_self"> </a> <br>
<a href="" target="_self"> </a><br>
<a href="" target="_self"> </a> <br>
<a href="" target="_self"> </a> <br>
<a href="" target="_self"> </a> <br>
<a href="" target="_self"> </a> <br>
<a href="" target="_self"> </a> <br>
<a href="" target="_self"> </a> <br>
<a href="" target="_self"> </a><br>
</div>
</div>