I am attempting to create a vertical menu with a scroll bar.
The issue I'm facing is that the sub-menu is hidden below the scroll bar. Here is the preview
This is the code I have implemented:
HTML Code
<div class="scrollbar" id="ex4">
<div class="content">
<div id="menuwrapper">
<ul>
<li><a href="#">Home</a>
</li>
<li><a href="#">Products</a>
<ul>
<li><a href="#">Product 1</a>
<ul>
<li><a href="#">Sub Product 1</a>
</li>
<li><a href="#">Sub Product 2</a>
</li>
<li><a href="#">Sub Product 3</a>
</li>
</ul>
</li>
<li><a href="#">Product 2</a>
</li>
<li><a href="#">Product 3</a>
</li>
</ul>
</li>
<li><a href="#">About Us</a>
... (additional HTML code here)
</ul>
</div>
</div>
CSS Code
.scrollbar {
width: 250px;
height: 300px;
background-color: lightgray;
margin-top: 40px;
margin-left: 40px;
overflow-y: scroll;
float: left;
}
.content {
height: 450px;
}
#ex4::-webkit-scrollbar {
... (CSS code continues)
Is anyone able to identify the issue?