- 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
CSS overflow: auto
The CSS overflow: auto, adds a scrollbar only when it's needed, unlike overflow:scroll. You can try to run the following code to implement CSS overflow: auto property:
Example
<!DOCTYPE html> <html> <head> <style> div { background-color: orange; width: 250px; height: 45px; border: 2px solid blue; overflow: auto; } </style> </head> <body> <h1>Heading</h1> <div>Overflow property used here. This is a demo text to show the working of CSS overflow: auto. This won't hide the content. A scrollbar would be visible, only if needed.</div> </body> </html>
Output
- Related Articles
- CSS overflow: visible
- CSS overflow: hidden
- CSS overflow: scroll
- CSS overflow-y
- CSS overflow-x
- CSS text-overflow property
- Values of CSS overflow property
- Working with CSS Overflow Property
- How to Fix Overflow Issues in CSS Flex Layouts?
- Usage of CSS grid-auto-rows property
- Usage of CSS grid-auto-columns property
- Usage of CSS grid-auto-flow property
- Auto Grow a Textarea with JavaScript in CSS
- Heap overflow and Stack overflow
- Role of margin property with value auto using CSS

Advertisements