CSS Overflow
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 box
- hidden – The overflow is clipped, and the rest of the content will be invisible
- scroll – the overflow is clipped, and a scrollbar is added to see the rest of the content
- auto – Similar to scroll, but it adds scrollbars only when necessary
1. overflow: visible
By default, the overflow is visible, meaning that it is not clipped and it renders outside the element’s box:
CODE:
Result:
2. overflow: hidden
With the hidden value, the overflow is clipped, and the rest of the content is hidden:
CODE:
Result:
3. overflow: scroll
Setting the value to scroll, the overflow is clipped and a scrollbar is added to scroll inside the box. Note that this will add a scrollbar both horizontally and vertically (even if you do not need it):
CODE:
Result:
4. overflow: auto
The auto value is similar to scroll, but it adds scrollbars only when necessary:
CODE:
Result:
All CSS Overflow Properties
You may also like: CSS Position
I all the time emailed this web site post page to all my contacts, since if like to read it next my links will too. Melesa Ker Bastian
Thank you for sharing your thoughts. I really appreciate your efforts and I will be waiting for your next post thanks once again. Heidie Garth Mosera
I savor, result in I found just what I was taking a look for. Cleopatra Ode Nawrocki