i

Learn HTML and CSS in 10 Days

CSS Overflow

This property of CSS helps in handling the content whenever they overfly the block level container.

Let’s have a look at some of the property values of CSS.

  • Visible – It tells that the overflow is not clipped.

  • Hidden – It tells that the overflow is clipped, and the leftover content will not be visible.

  • Scroll - It tells that the overflow is clipped, and to see the leftover content, one can use the scroll bar.

  • Auto – It tells that if the overflow is clipped, then a scroll bar is required to have a view at the rest of the content.

  • Inherit – It takes all the property from the parent element.

  • Initial – It is utilized to make the property to its original initial value.

div.scroll { 

background-color: #00ffff; 

width: 90px; 

height: 90px; 

overflow: scroll; 

 

div.hidden { 

background-color: #00FF00; 

width: 90px; 

height: 160px; 

overflow: hidden; 

The property tells us what one should do if the content of an element is more than the size of the element's box.