Hi there, I’m currently working on my product landing page project and I’m trying to create a hoverable dropdown menu with a list of the characteristics of the product. (The product is a little far out but I figured I would have fun with the project and base my page off of the game Destiny 2.) Initially, it was working as intended but seems to have broken somehow, as I was working on styling the header and navbar. Any advice would be greatly appreciated.
Below is a piece of the html code and the css for the dropdown:
HTML:
<div id="row">
<div id="img-desc-container">
<div class="product-img-div">
<img src="https://i.imgur.com/xlJI5eC.jpg" id="product-img"></div>
<div id="product-name" class="dropdown">
<button class="drop-btn"><h1 class="dropdown-title">BYGONES</h1></button>
<div class="dropdown-content">
<ul>
<li>Kinetic Pulse Rifle</li>
<li>Adaptive Frame</li>
<li>Corkscrew Rifling</li>
<li>Flared Magwell</li>
<li>Kill Clip</li>
<li>Full-Auto Trigger</li>
</div>
</div>
CSS:
.drop-btn {
background-color: #6f7072;
border: none;
min-width: 385px;
min-height: 216px;
}
.product-name {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #85827B;
min-width: 385px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
}
.dropdown-content ul:hover {
background-color: #85827B;
}