Overflow Property

Last updated: 2026-09-13

overflow Overflow Property

The overflow property controls what happens when content exceeds its container's bounds and is the core tool for dealing with overflowing content. The default value, visible, lets overflowing content show; hidden clips it; scroll always displays scrollbars; and auto shows scrollbars only when needed, which is the most commonly used value.

Category
Initial Valuevisible
InheritedNo
Applies Toblock-container
Animation Typediscrete
CSS VersionCSS2
StatusStandard

📝 Syntax

overflow: visible | hidden | clip | scroll | auto;

⚙️ Values

ValueTypeDescription
visible | hidden | scroll | autoKeywordHow overflowing content is handled.

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
overflow v4 v12 v1 v3.1 v10
Supported in all major browsers
Tip: overflow:hidden or auto creates a new block formatting context (BFC), which can also be used to clear floats.

❓ FAQ

QWhat's the difference between overflow:auto and overflow:scroll?
Ascroll always shows scrollbars, even when content does not overflow, and reserves scrollbar space in both directions. auto shows scrollbars only when content actually overflows and hides them entirely otherwise, which looks cleaner. For most use cases, auto is recommended. Note that both confine content to the box, so elements inside the scrollable area cannot scroll past the parent, and neither prevents the page itself from scrolling.
QHow do I make content scrollable when it overflows?
AFirst give the container a definite height using height or max-height, then set overflow:auto or scroll. Once content exceeds the container's size it can be scrolled into view, for example .list { height:300px; overflow:auto; }. For whole-page scrolling, do not restrict overflow on html or body, or the page will lose its default scrolling behavior. Also make sure the container's width is constrained, since horizontal overflow is a common side effect.
QWhy does overflow:hidden clear floats?
AWhen overflow is set to hidden, auto, scroll, or clip, the element creates a block formatting context (BFC). A BFC takes the height of its floated children into account, fixing the collapsed-parent problem. That is why adding overflow:hidden to a float's parent is a classic clearing technique; just keep in mind that it also clips any overflowing content, which may cut off dropdowns or tooltips that extend beyond the box.
QWhat's the difference between overflow:hidden and overflow:visible?
Avisible, the default, renders overflowing content outside the box; it does not affect layout but may cover neighboring elements. hidden clips the overflow so the content is invisible and cannot be scrolled into view. hidden is commonly used to create a BFC, to clip content within rounded corners via border-radius, and to hide decorative overflow, while visible is best left for cases where overflow genuinely should escape the container.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏