22

I have a page I'm working on that encompasses a vertical drop-down menu. However, when the menu drops down, it pushes the text below it downwards and off the page. This is expected, but this enables the scroll bar on the side of the page. I was wondering it there was a way to get rid of this. In other words, it shouldn't just not scroll, but never even offer the option to scroll.

Thanks!

2 Answers 2

34

If you want no scrollbar to appear and no scrolling whatsoever to occur, in the CSS for the div in which you contain said dropdown use

overflow: hidden;

This will cut off any 'additional content' though; see an example here

2
  • Wow, that was easy. Thanks for the quick and thorough answer.
    – Aaron
    Commented Aug 20, 2012 at 2:28
  • So, when this doesn't work what would be a possible reason why? Commented Nov 8, 2018 at 22:39
7

Use overflow: hidden; on the element you want to hide the scrollbar on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.