The overflow
property specifies whether to clip the content or to add scrollbars when the content of an element is too big to fit in the specified area.
The overflow property has the following values:
visible
- Default. The overflow is not clipped. The content renders outside the element’s boxhidden
- The overflow is clipped, and the rest of the content will be invisiblescroll
- The overflow is clipped, and a scrollbar is added to see the rest of the contentauto
- Similar to scroll, but it adds scrollbars only when necessaryEx:
.box {
width: 200px;
height: 200px;
border: 3px solid gold;
/* set overflow property to 'auto' */
overflow: auto;
}
==Note: The overflow property only works for block elements with a specified height.==
==Note: In OS X Lion (on Mac), scrollbars are hidden by default and only shown when being used (even though “overflow:scroll” is set).==