overflow: auto का उपयोग
overflow: auto ब्राउज़र को केवल तब स्क्रॉलबार जोड़ने का निर्देश देता है जब कंटेंट कंटेनर से बाहर निकल रहा हो। overflow: scroll के विपरीत, यह अनावश्यक स्क्रॉलबार नहीं दिखाता।
उदाहरण
<!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>
सर्वोत्तम अभ्यास: अधिकांश मामलों में overflow: auto ही पसंद किया जाता है क्योंकि यह यूजर अनुभव को साफ रखता है।