Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a page unscrollable?

Tags:

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!

like image 752
Aaron Avatar asked Aug 20 '12 02:08

Aaron


People also ask

How do you make an Unscrollable page?

To hide the vertical scrollbar and prevent vertical scrolling, use overflow-y: hidden like so: HTML.

How do I make my html page Unscrollable CSS?

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

How do I stop my page from scrolling in CSS?

Disabling scroll with only CSS. There's another way to disable scrolling that is commonly used when opening modals or scrollable floating elements. And it is simply by adding the CSS property overflow: hidden; on the element you want to prevent the scroll.


1 Answers

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

like image 64
khaverim Avatar answered Sep 20 '22 19:09

khaverim