Sunday 18 August 2019

The Overflow property

The overflow property specifies what happens if content overflows an element’s box.
This property specifies whether to clip content or to add scrollbars when an element’s content is too big to fit in a specified area.
div {
     width: 150px;
     height: 150px;
     overflow: scroll;
 }
ValueDescription
visibleThe overflow is not clipped. It renders outside the element’s box. This is default
hiddenThe overflow is clipped, and the rest of the content will be invisible
scrollThe overflow is clipped, but a scroll-bar is added to see the rest of the content
autoIf overflow is clipped, a scroll-bar should be added to see the rest of the content
initialSets this property to its default value.
inheritInherits this property from its parent element.