How to Fix Vertical Scroll bar Issue in Responsive Dropdown Menu?


Hi @Mohammad I followed the tutorial on MBT, how to create a drop down responsive.

I put it on my blog, but I let a fixed position on the top screen (CSS, Position: fixed). I then tested the “how much the list appears on the screen”. When the list full in screen, a next links then closed on the bottom screen.

I then tried to give height and then give css (overflow-y: scroll), it could be the scroll but not adjust the screen height. Sometimes scroll function appears when the screen is still quite high showing the rest of the list of links

how to keep it in a scroll dropdown when the link is closed due to high screen Sorry for my bad english :blush:


Follow this simple fix

Inside the following class

@media screen and (max-width: 800px)
#mbt_bar ul {
height: 240px;
overflow-y: scroll;
  • Replace height: 240px; with height: auto;
  • Next replace overflow-y: scroll; with overflow-y: auto;

This will remove the fixed height and scroll and instead show the scroll-bar when the height exceeds the screen length.


It doesn’t work Buddy. Vertical scroll does not appear. I think, should have height value for detect the height of the screen

maybe like this: @media screen (max-height: 300px)