Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between HTML "overflow : auto" and "overflow : scroll"

Tags:

html

css

Auto will only show a scrollbar when any content is clipped.

Scroll will however always show the scrollbar even if all content fits and you cant scroll it.


overflow: scroll will hide all overflowing content and cause scroll bars to appear on the element in question. If the content does not overflow, the scrollbars will still be visible, but disabled.

overflow: auto is very similar, but the scrollbars only appear when the content is overflowing.

There is a similar explanation of this here, with some screenshots to illustrate the point.


Take a look at CSS Tricks.

Auto will show scrollbar if and only if the content overflows; but scroll will always show the scrollbar, whether the content is overflowing or not.


Adding a point to the answer, Overflow:auto not worked in IE7 when position of the container is absolute Position relative overflow IE7. But setting Overflow:scroll works