overflow-wrap

Tells the browser whether it is allowed to break a very long word (like an ID or URL) onto a new line if it would otherwise overflow its container.

It is documented as part of the CSS Text specification.

/* Usage Example */
.sidebar {
  /* Forces long URLs or IDs to break so they don't leak out of the sidebar */
  overflow-wrap: break-word;
}

/* Syntax */
overflow-wrap: normal;
overflow-wrap: break-word;
overflow-wrap: anywhere;

/* Global values */
overflow-wrap: inherit;
overflow-wrap: initial;
overflow-wrap: revert;
overflow-wrap: revert-layer;
overflow-wrap: unset;
Widely available Since 2018 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2018.

23+
49+
7+
18+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC