Overflow

The overflow property sets the desired behavior when content of element is too big to fit in its.

property description
overflow Sets behavior for both directions. Prossible values are:
  • visible - content is not clipped and may be rendered outside the padding box
  • hidden - content is clipped if necessary to fit the padding box. You can scroll content programmatically.
  • clip - content is clipped if necessary to fit the padding box. You can not scroll content programmatically.
  • scroll - content is clipped if necessary to fit the padding box. Browsers always display scrollbars whether or not any content is actually clipped.
  • auto - if content fits inside the padding box, it looks the same as visible. Desktop browsers provide scrollbars if content overflows.
overflow-x Sets behavior for x direction.
overflow-y Sets behavior for y direction.

Overflow may not work on an element that does not have a fixed size. For example, <pre> element without a specified width with long text. Or with size 100%, but parent element also without the specified width.