Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overflow-x scroll but otherwise hide the scrollbar

Tags:

css

overflow

I have just a simple line of code...

overflow-x: scroll;

... and it causes a scroll bar to appear in Chrome. How do I tell it to go away unless I need it?

like image 979
ilarsona Avatar asked Nov 14 '13 05:11

ilarsona


People also ask

How do I stop scrolling without scrollbar hiding?

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.

How do you make the scrollbar only visible when overflow?

Use overflow: auto . Scrollbars will only appear when needed. (Sidenote, you can also specify for only the x, or y scrollbar: overflow-x: auto and overflow-y: auto ).

How can I hide scrollbar in iframe but still scroll?

1. Set the overflow of the parent div as hidden. 2. Set the overflow of the child div to auto and the width 200% (or anything more than 100%, or more than the width of the parent - so that the scrollbar gets hidden).


1 Answers

overflow:auto; will show scroll bars only if required.

like image 112
Pradyumna Challa Avatar answered Nov 15 '22 05:11

Pradyumna Challa