Overflow


Overflow is used to tidy up content among certain elements, mainly divs. It allows websites to look a lot less messy and looks cleaner in general. In your CSS/style, the command goes:

div { background-color: (your choice, recommend that you put a color in here that is not white) overflow: scroll/hidden/auto/visible

There are four properties in Overflow: Scroll, Hidden, Auto, and Visible. The Scroll property adds scrollbars to the side so that the viewer can scroll down. The Hidden property cuts off overflowed text from the div. The Auto property either sets the the property to Scroll or Visible, and finally, Visible, or the default property, shows all text in the section.

Exercise

In this excercise, you will convert an overflowed div into a cleaner div with a scrollbar on the side.


Copyright © learn-html.org. Read our Terms of Use and Privacy Policy