CSS overflow Property Last Updated : 19 Jul, 2024 Comments Improve Suggest changes Like Article Like Report The CSS overflow property is used to set the overflow behavior of an element. It is the shorthand property of overflow-x and overflow-y properties. This property is used to control the large content.Syntax:overflow: visible | hidden | clip | scroll | auto;Property Values:visible: The content is not clipped and is visible outside the element box. hidden: The overflow is clipped and the rest of the content is invisible.clip: It is used to clip the content to fit the padding box.scroll: The overflow is clipped but a scrollbar is added to see the rest of the content. The scrollbar can be horizontal or vertical.auto: It automatically adds a scrollbar whenever it is required. Example 1: The following code demonstrates the CSS overflow: auto property. HTML <!DOCTYPE> <html> <head> <title> CSS overflow Property </title> <style> h1 { color: green; } p { width: 200px; height: 100px; border: 1px solid; overflow: auto; text-align: justify; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h3>CSS overflow Property</h3> <p> CSS (Cascading Style Sheets)is used to apply styles to web pages. Cascading Style Sheets are fondly referred to as CSS. It is used to make web pages presentable. The reason for using this is to simplify the process of making web pages presentable. It allows you to apply styles on web pages. More importantly, it enables you to do this independently of the HTML that makes up each web page. </p> </body> </html> Output:Example 2: The following code shows that the overflow feature is hidden by using theoverflow:hidden property. HTML <!DOCTYPE> <html> <head> <title> CSS overflow Property </title> <style> h1 { color: green; } p { width: 200px; height: 100px; border: 1px solid; overflow: hidden; text-align: justify; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h3>CSS overflow Property</h3> <p> CSS (Cascading Style Sheets)is used to apply styles to web pages. Cascading Style Sheets are fondly referred to as CSS. It is used to make web pages presentable. The reason for using this is to simplify the process of making web pages presentable. It allows you to apply styles on web pages. More importantly, it enables you to do this independently of the HTML that makes up each web page. </p> </body> </html> Output: Supported Browsers:Chrome 1Edge 12Firefox 1Opera 7Safari 1 Comment More infoAdvertise with us Next Article CSS overflow Property B blalverma92 Follow Improve Article Tags : Web Technologies CSS CSS-Properties Similar Reads CSS overflow-x Property The overflow-x property in CSS specifies whether to add a scroll bar, clip the content, or display overflow content of a block-level element, when it overflows at the left and right edges. In other words, this property helps us to display the content which is overflowing from the page horizontally.T 3 min read CSS overflow-y Property The overflow-y property of CSS specifies the behavior of content when it overflows a block-level element's top and bottom edges. The content may be clipped, hidden or a scrollbar may be displayed accordingly based on the value assigned to the overflow-y property. Syntax: overflow-y: scroll | hidden 5 min read CSS | overflow-wrap Property The overflow-wrap property in CSS is used to specify that the browser may break lines of text inside any targeted element to prevent overflow when the original string is too long to fit. This property was earlier known as word-wrap that still supported by some browsers but it was renamed to overflow 1 min read CSS Overflow The CSS overflow controls the big content. It tells whether to clip content or to add scroll bars. Try It: .custom-item { border: 1px solid gray; font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; border-radius: 3px; margin: auto; margin-top: 5px; max-width: 320px; min-wi 4 min read Primer CSS Layout Overflow Primer CSS is a free open-source CSS framework that is built upon systems that create the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure our patterns are steady and interoperable with every other. Its approach to CSS is influenced by 6 min read Like