<body>
<div class = "CentralHeader">
<div class = "LinkBar" id = "HeaderBar" >All</div>
<div class = "SampleMenu">
<ul>
<li><a href = "#Movies">Movies</a></li>
<li><a href = "#Events">Events</a></li>
<li><a href = "#Sports">Sports</a></li>
<li><a href = "#Plays">Plays</a></li>
</ul>
</div>
</div>
<style type="text/css">
.LinkBar {
cursor: pointer;
width: 140px;
height: 37px;
border: 1px solid #c02c3a;
margin-top: 50px;
margin-left: 300px;
background-color: #c02c3a;
text-align: center;
padding-top: 9px;
color: white;
}
div.SampleMenu ul {
list-style-type: none;
width: 140px;
background-color: Grey;
margin-left: 300.5px;
padding: 0;
margin-top:0px;
display: none;
border-top: 2px solid #fff;
}
div.SampleMenu ul li {
padding: 0;
}
div.SampleMenu ul li a {
color: white;
display: block;
padding: 10px;
font-size: large;
text-align: center;
text-decoration: none;
}
#HeaderBar:hover+.SampleMenu ul,
.SampleMenu ul:hover {
display: block;
}
</style>
</body>
Why does the dropdown functionality in the code disappear when the search bar div is removed? The issue seems to be related to the display setting of the ul inside the SampleMenu div. When set to auto, the dropdown works fine. What could be causing this disruption in the flow?