VOOZH about

URL: https://www.geeksforgeeks.org/css/css-overflow-property/

⇱ CSS overflow Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

CSS overflow Property

Last Updated : 23 Jul, 2025

The CSSoverflow 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.

Output:

Example 2: The following code shows that the overflow feature is hidden by using theoverflow:hidden property.

Output:

👁 Image

Supported Browsers:

  • Chrome 1
  • Edge 12
  • Firefox 1
  • Opera 7
  • Safari 1
Comment
Article Tags: