Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Typography

The line-break property

Reference for the CSS line-break property: auto, loose, normal, strict and anywhere. Learn how it changes wrapping, mainly for CJK text, with a live example.

The line-break property sets how strict the browser is when it chooses places to wrap a line. Its main audience is Chinese, Japanese and Korean text, where there are several rule sets about which characters may start or end a line, for example small kana or certain punctuation marks.

One value, anywhere, is useful for every language: it allows a soft wrap opportunity after every character, which makes it a quick way to wrap very long strings in narrow spaces.

CSS
.narrow-column {
  line-break: strict;
}

Try it

auto versus anywhere

With auto, the long address cannot be split and pokes out of its box. With anywhere, every character is a possible break point, so the address wraps inside the box.

Syntax

CSS
line-break: auto | loose | normal | strict | anywhere;
Initial value auto
Applies to all elements
Inherited yes
Animatable no
Computed value as specified

Values

Value Description
auto The browser picks the rule set. It may be less strict for short lines, such as in narrow columns.
loose The least restrictive rules, usually for short lines of text such as newspaper columns.
normal The most common rules for line breaking.
strict The most restrictive rules, for example it forbids breaks before small kana and the prolonged sound mark in Japanese.
anywhere A soft wrap opportunity exists around every typographic character unit, including after punctuation and inside what would normally be a word. No hyphens are added.

Usage notes

  • Latin text is mostly unaffected by loose, normal and strict. Only anywhere visibly changes English text.
  • Which Japanese characters are affected depends on the rule sets, so differences between loose, normal and strict appear only with specific characters at the edge of a line. Test with real content in the target language.
  • anywhere versus overflow-wrap: anywhere. overflow-wrap breaks a word only if it would overflow. line-break: anywhere makes break opportunities everywhere, so ordinary words may also split at the end of a line.
  • anywhere and intrinsic sizes. It affects min-content sizing, so flex and grid items containing such text can shrink more than usual.
  • Readability. Do not apply anywhere to whole paragraphs of prose. Reserve it for identifiers, paths and URLs.
  • Language. Set lang on the content (for example lang="ja") so the browser uses the right tailoring.

Browser support

All current browsers support the property, but the exact rule sets differ in detail between engines, so check a compatibility table and test CJK content in each one.