2 min read
•Question 19 of 38easyHow to handle Overflow in Tailwind?
Overflow and scrolling utilities.
What You'll Learn
- Overflow control
- Scrolling behavior
- Text overflow
Overflow Classes
index.htmlHTML
<div class="overflow-auto">Scroll if needed</div>
<div class="overflow-hidden">Clip overflow</div>
<div class="overflow-scroll">Always show scrollbar</div>
<div class="overflow-visible">Show overflow</div>Directional Overflow
index.htmlHTML
<div class="overflow-x-auto overflow-y-hidden">
Horizontal scroll only
</div>Scroll Behavior
index.htmlHTML
<div class="scroll-smooth">Smooth scrolling</div>
<div class="overscroll-contain">Contain scroll chaining</div>Text Overflow
index.htmlHTML
<p class="truncate">Ellipsis on overflow...</p>
<p class="text-ellipsis overflow-hidden">Same as truncate</p>
<p class="text-clip overflow-hidden">Clips without ellipsis</p>Scrollbar Styling
index.htmlHTML
<div class="scrollbar-thin scrollbar-thumb-gray-400">
Custom scrollbar (with plugin)
</div>