Asim K T
Asim K T

Reputation: 18154

What's the difference between `overflow` properties `overlay` and `scroll`

What's the difference between overflow properties overlay and scroll. Both adding scrollbar to overflowing content.

Upvotes: 7

Views: 6077

Answers (2)

Isabel Inc
Isabel Inc

Reputation: 1899

Scroll will always show scroll bars irrespective of if the content is being clipped or not.

Overlay was a webkit proprietary property but is now depreciated. It does the same thing that auto does. Which is display a scroll bar when necessary.

Just as a side note the current possible values for overflow are

auto
hidden
scroll
visible

Great article here by css tricks documenting the difference. https://css-tricks.com/the-css-overflow-property/

Upvotes: 9

Sascha
Sascha

Reputation: 635

Quote from quirksmode.org

scroll: always show horizontal and vertical scrollbars, regardless of whether they're necessary. This value is never used; you generally want auto.

overlay: non-standard value only supported by the WebKit-browsers that does the same as auto.

Upvotes: 4

Related Questions