
Without the scroll area, that limitation is no longer there. Keeping the scroll area around means that the UI still could end up being scrolled, and because it was a scroll area, it also prevented the non-scrolling axis to be set to visible. Enter ClipĬlip was added for a particular reason: an element with overflow: hidden could still programmatically scroll (just not as the result of a user interacting with it). That limits the type of design you can implement without adding additional HTML to style. See the Pen Overflow: Clip example by Kilian Valkhof ( on CodePen. Setting two different directional overflows would let you configure your element such that it (for example) only scrolls in the vertical direction while wrapping text and hiding overflows in the horizontal direction, a common requirement.īut it turns out, they have a hidden dependency: You can't have one axis be hidden in any way (hidden, scroll and auto all limit the content from expanding beyond the element) while having the other one set to visible: overflow: hidden scroll will hide any horizontal overflows while adding a scrollbar for the vertical direction. Overflow is also a shorthand that also allows for two values: the first for the x direction and the second for the y direction. While overflow sets the overflow value for both axis, you can set a different value for both the x and y axis with overflow-x and overflow-y or with overflow-inline and overflow-block if you want to use logical properties. Often times You want overflow: auto, not overflow: scroll. auto: Depending on if the content fits or not the element gets a scrollbar.scroll: The element is made into a scrollable area with scrollbar, regardless of whether the content requires it.hidden: The content is clipped to the element and overflowing content is hidden.visible: The default value: any content that overflows is visibly rendered just where it would be if the block element was larger.The overflow property lets you control how content that overflows a block element should be displayed. So what does it do?īefore diving into clip, lets quickly go over what overflow does and what it's other values do.

Typi non habent claritatem insitam est usus legentis in iis qui facit eorum claritatem.You probably know overflow: hidden, overflow: scroll and overflow: auto, but do you know overflow: clip? It's a relatively new value for the overflow property, and with Safari 16 being released later this year all evergreen browsers will support it. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

Therefore, a scrollbar is added to help the reader to scroll the content. This text is really long and the height of its container is only 100 pixels.

The overflow property controls what happens to content that is too big to fit into an area.
