Overflow Wrap
Controls word wrapping
Class | Style |
---|---|
ow-bw | overflow-wrap: break-word;
|
ow-n | overflow-wrap: normal;
|
Break Word
This example sets the overflow wrap to break-word. The browser will break long words and wrap them onto the next line to prevent overflow.
Pneumonoultramicroscopicsilicovolcanoconiosis
<div class="bg-indigo-1 p-4 rad-1 ow-bw"> <p class="bg-white fs-lg p-4 rad-1 ta-c tc-slate">Pneumonoultramicroscopicsilicovolcanoconiosis</p></div>
Normal
Initial value
This example sets the overflow wrap to normal. The browser will only break lines at allowed break points, and long words will overflow the container if they cannot fit.
Pneumonoultramicroscopicsilicovolcanoconiosis
<div class="bg-indigo-1 p-4 rad-1"> <p class="bg-white fs-lg p-4 rad-1 ta-c tc-slate o-auto ow-n">Pneumonoultramicroscopicsilicovolcanoconiosis</p></div>
Conditional styles
Learn how to override existing utilities based on the user’s screen size or other factors, such as hover states.
Breakpoint variant
You can combine responsive breakpoints like sm:ow-*
,md:ow-*
, lg:ow-*
, and xxl:ow-*
allows targeting specific utilities in different viewports.
<div class="ow-n md:ow-bw ..."></div>
Hover variant
Alternatively, you can apply :hover
by using h:ow-*
utility to override elements and change their values when hovering over them.
<div class="ow-n h:ow-bw ..."></div>