- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Which property is used to tell the browser what to do if the box's content is larger than the box itself?
CSS provides a property called overflow which tells the browser what to do if the box's contents are larger than the box itself. This property can take one of the following values −
Value | Description |
---|---|
visible | Allows the content to overflow the borders of its containing element. |
hidden | The content of the nested element is simply cut off at the border of the containing element and no scrollbars are visible. |
scroll | The size of the containing element does not change, but the scrollbars are added to allow the user to scroll to see the content. |
auto | The purpose is the same as a scroll, but the scrollbar will be shown only if the content does overflow. |
Example
You can try to run the following code to implement the overflow property −
<html> <head> </head> <style> .scroll{ display:block; border: 2px solid green; padding:10px; margin-top:10px; width:300px; height:50px; overflow:scroll; } .auto{ display:block; border: 2px solid green; padding:10px; margin-top:10px; width:300px; height:50px; overflow:auto; } </style> <body> <p>Example of scroll value:</p> <div class = "scroll"> I am going to keep lot of content here just to show you how scrollbars works if there is an overflow in an element box. This provides your horizontal as well as vertical scrollbars. </div> <br /> <p>Example of auto value:</p> <div class = "auto"> I am going to keep lot of content here just to show you how scrollbars works if there is an overflow in an element box. This provides your horizontal as well as vertical scrollbars. </div> </body> </html>
- Related Articles
- Which property is used to tell the browser what to do if the box's content is larger than the box itself?
- What to do when an element's content might be larger than the amount of space allocated to it?
- What to do with content that renders outside the element box with JavaScript?
- Which CSS property is to be used to set the speed curve of the Animation?
- What is the fraction which when multiplied by itself gives 0.00053361?
- One number is three times another. If the larger number is subtracted from $48$ the result is $4$ less than the smaller number subtracted from $32$ find the larger number.
- Oranges are to be transferred from larger boxes into smaller boxes. When a large box is emptied, the oranges from it fill two smaller boxes and still 10 oranges remain outside. If the number of oranges in a small box are taken to be ( x ), what is the number of oranges in the larger box?
- Which term is used to denote a speed greater than the speed of sound?
- (a) What do the letters p.d. stand for?(b) Which device is used to measure p.d.?
- How to Tell if Gold is Real?
- Which property is used in CSS to control the repetition of an image in the background?
- Which property is used in CSS to control the position of an image in the background?
- Which property is used in CSS to control the scrolling of an image in the background?
- Which is the best browser to use: Chrome, Explorer, or Firefox?
- Which element is used to insert some content after an element with CSS
- Which element is used to insert some content before an element with CSS

Advertisements