overflow-wrap

Class Description

wrap-break-word

Sets overflow-wrap to break-word, breaking unbreakable words to prevent overflow.

CSS Rules

.wrap-break-word {
  overflow-wrap: break-word;
}

Usage

<element class="wrap-break-word" />

Responsive

Prefix .wrap-break-word utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:wrap-break-word" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="wrap-break-word:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="wrap-break-word:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before wrap-break-word::before" />

<element class="content-after wrap-break-word::after" />
.wrap-break-word Sets overflow-wrap to break-word, breaking unbreakable words to prevent overflow.

wrap-anywhere

Sets overflow-wrap to anywhere, allowing unbreakable words to break at any point.

CSS Rules

.wrap-anywhere {
  overflow-wrap: anywhere;
}

Usage

<element class="wrap-anywhere" />

Responsive

Prefix .wrap-anywhere utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:wrap-anywhere" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="wrap-anywhere:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="wrap-anywhere:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before wrap-anywhere::before" />

<element class="content-after wrap-anywhere::after" />
.wrap-anywhere Sets overflow-wrap to anywhere, allowing unbreakable words to break at any point.

wrap-normal

Sets overflow-wrap to normal, preventing breaks within words.

CSS Rules

.wrap-normal {
  overflow-wrap: normal;
}

Usage

<element class="wrap-normal" />

Responsive

Prefix .wrap-normal utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:wrap-normal" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="wrap-normal:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="wrap-normal:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before wrap-normal::before" />

<element class="content-after wrap-normal::after" />
.wrap-normal Sets overflow-wrap to normal, preventing breaks within words.