Utilities for controlling how the text of an element overflows.
2025-04-09
Written by: tdtc
| Class | Styles |
|---|---|
| text-ellipsis | text-overflow: ellipsis; |
| text-clip | text-overflow: clip; |
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Use the truncate utility to prevent text from wrapping and truncate overflowing text with an ellipsis (…) if needed:
<p class="truncate">The longest word in any of the major...</p>
Use the text-ellipsis utility to truncate overflowing text with an ellipsis (…) if needed:
<p class="overflow-hidden text-ellipsis">The longest word in any of the major...</p>
Use the text-clip utility to truncate the text at the limit of the content area:
<p class="overflow-hidden text-clip">The longest word in any of the major...</p>
This is the default browser behavior.