working - Difference between HTML “overflow:auto” and “overflow:scroll”
scroll container html (3)
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.
When I was studying the
overflow property's values, I came across these two values:
scroll, which adds scrollbar(s) if the content overflows the element.
Could someone please explain me whats the difference between them?
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
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.