Skip to content

Overflow ​

Utilities for controlling the overflow behavior of an element.

Class NameCSS Equivalent
overflow-visibleoverflow: visible;
overflow-x-visibleoverflow-x: visible;
overflow-y-visibleoverflow-y: visible;
overflow-hiddenoverflow: hidden;
overflow-x-hiddenoverflow-x: hidden;
overflow-y-hiddenoverflow-y: hidden;
overflow-clipoverflow: clip;
overflow-x-clipoverflow-x: clip;
overflow-y-clipoverflow-y: clip;
overflow-scrolloverflow: scroll;
overflow-x-scrolloverflow-x: scroll;
overflow-y-scrolloverflow-y: scroll;
overflow-autooverflow: auto;
overflow-x-autooverflow-x: auto;
overflow-y-autooverflow-y: auto;

Showing content that overflows ​

The .overflow-visible class sets the overflow property to visible. This allows content to overflow the element's box if needed, and scrollbars are not displayed.

Alice Johnson
CEO
html
<div class="overflow-visible">
  <!-- Overflowing content here -->
</div>

Showing content that overflows horizontally ​

The .overflow-x-visible class sets the overflow-x property to visible. Horizontal overflow is allowed, and scrollbars are not displayed.

html
<div class="overflow-x-visible">
  <!-- Horizontal overflowing content here -->
</div>

Showing content that overflows vertically ​

The .overflow-y-visible class sets the overflow-y property to visible. Vertical overflow is allowed, and scrollbars are not displayed.

html
<div class="overflow-y-visible">
  <!-- Vertical overflowing content here -->
</div>

Hiding content that overflows ​

The .overflow-hidden class sets the overflow property to hidden. Content that overflows the element's box is hidden, and scrollbars are not displayed.

Alice Johnson
CEO
html
<div class="overflow-hidden">
  <!-- Hidden overflowing content here -->
</div>

Hiding content that overflows horizontally ​

The .overflow-x-hidden class sets the overflow-x property to hidden. Horizontal overflow is hidden, and scrollbars are not displayed.

html
<div class="overflow-x-hidden">
  <!-- Hidden horizontal overflowing content here -->
</div>

Hiding content that overflows vertically ​

The .overflow-y-hidden class sets the overflow-y property to hidden. Vertical overflow is hidden, and scrollbars are not displayed.

html
<div class="overflow-y-hidden">
  <!-- Hidden vertical overflowing content here -->
</div>

Scrolling if needed ​

The .overflow-auto class sets the overflow property to auto. Scrollbars are displayed if the content overflows the element's box. Scrollbars appear only when needed.

Alice Johnson
CEO
Bob Smith
Technical Advisor
Charlie Brown
CTO
Diana Miller
CFO
Ella Wilson
Software Engineer
Frank Davis
Marketing Manager
Grace Brown
Technical Advisor
Hank Anderson
HR Manager
Isabella Martinez
Software Engineer
John Davis
Marketing Manager
html
<div class="overflow-auto">
  <!-- Auto-scrollable overflowing content here -->
</div>

Scrolling horizontally if needed ​

The .overflow-x-auto class sets the overflow-x property to auto. Horizontal scrollbars are displayed if the content overflows horizontally. Scrollbars appear only when needed.

Alice
Bob
Charlie
Diana
Ella
Frank
Grace
Hank
Isabella
John
html
<div class="overflow-x-auto">
  <!-- Horizontal auto-scrollable overflowing content here -->
</div>

Scrolling vertically if needed ​

The .overflow-y-auto class sets the overflow-y property to auto. Vertical scrollbars are displayed if the content overflows vertically. Scrollbars appear only when needed.

Alice Johnson
CEO
Bob Smith
Technical Advisor
Charlie Brown
CTO
Diana Miller
CFO
Ella Wilson
Software Engineer
Frank Davis
Marketing Manager
Grace Brown
Technical Advisor
Hank Anderson
HR Manager
Isabella Martinez
Software Engineer
John Davis
Marketing Manager
html
<div class="overflow-y-auto">
  <!-- Vertical auto-scrollable overflowing content here -->
</div>

Scrolling in all directions ​

The .overflow-scroll class sets the overflow property to scroll. Scrollbars are displayed if the content overflows the element's box.

html
<div class="overflow-scroll">
  <!-- Scrollable overflowing content here -->
</div>

Scrolling horizontally always ​

The .overflow-x-scroll class sets the overflow-x property to scroll. Horizontal scrollbars are displayed if the content overflows horizontally.

Alice Johnson
CEO
Bob Smith
Technical Advisor
Charlie Brown
CTO
Diana Miller
CFO
Ella Wilson
Software Engineer
Frank Davis
Marketing Manager
Grace Brown
Technical Advisor
Hank Anderson
HR Manager
Isabella Martinez
Software Engineer
John Davis
Marketing Manager
html
<div class="overflow-x-scroll">
  <!-- Horizontal scrollable overflowing content here -->
</div>

Scrolling vertically always ​

The .overflow-y-scroll class sets the overflow-y property to scroll. Vertical scrollbars are displayed if the content overflows vertically.

Alice Johnson
CEO
Bob Smith
Technical Advisor
Charlie Brown
CTO
Diana Miller
CFO
Ella Wilson
Software Engineer
Frank Davis
Marketing Manager
Grace Brown
Technical Advisor
Hank Anderson
HR Manager
Isabella Martinez
Software Engineer
John Davis
Marketing Manager
html
<div class="overflow-y-scroll">
  <!-- Vertical scrollable overflowing content here -->
</div>

Overflow: Clip ​

The .overflow-clip class sets the overflow property to clip. Content that overflows the element's box is clipped, and no scrollbars are displayed.

Alice Johnson
CEO
Bob Smith
Technical Advisor
Charlie Brown
CTO
Diana Miller
CFO
Ella Wilson
Software Engineer
Frank Davis
Marketing Manager
Grace Brown
Technical Advisor
Hank Anderson
HR Manager
Isabella Martinez
Software Engineer
John Davis
Marketing Manager
html
<div class="overflow-clip">
  <!-- Clipped overflowing content here -->
</div>

Overflow X: Clip ​

The .overflow-x-clip class sets the overflow-x property to clip. Horizontal overflow is clipped, and no scrollbars are displayed.

html
<div class="overflow-x-clip">
  <!-- Clipped horizontal overflowing content here -->
</div>

Overflow Y: Clip ​

The .overflow-y-clip class sets the overflow-y property to clip. Vertical overflow is clipped, and no scrollbars are displayed.

html
<div class="overflow-y-clip">
  <!-- Clipped vertical overflowing content here -->
</div>