CSS - Overflow

Overflow

Overflow property in CSS is used to specify or control what happens to the content that is too big to fit into the width and height of the container, screen size or area. The overflow property values include:

  • visible - content can be displayed outside the box if it doesn't fit.
  • hidden - content that doesn't fit will not be displayed outside the box.
  • scroll - add scrollbar to scroll and see content that doesn't fit.
  • auto - add scrollbar when necessary, automatically.

OVERFLOW X AND Y

You can also use overflow-x and overflow-y properties to specify overflow horizontally and vertically

OVERFLOW WRAP

We also have overflow-wrap property which is used to break lines with long words, if the container is set to overflow.

ADVERTISEMENTS

LEARNING IS A CONTINOUS PROCESS - PRACTICE MAKES PERFECT