Paragraphs & wrapping

line-break

line-break sets how strict the rules are that keep punctuation, small kana such as "っ", and similar characters from starting a line. It mainly matters for Japanese and Chinese text.

Syntax

auto | loose | normal | strict | anywhere

Preview

駅前にできた新しいお店でコーヒーを飲みました。ちょっと苦かったけれど、周りの人々は「おいしい」と言います。
Presets
Drag the bottom-right corner to resize

Code

.box {
  font-size: 15px;
  line-break: strict;
}

Controls

line-breakstrict
line-break
駅前にできた新しいお店でコーヒーを飲みました。ちょっと苦かったけれど、周りの人々は「おいしい」と言います。

About

Values

  • auto: the browser decides. It may change the rules with the line length, for example loosening them for short lines. This is the initial value.
  • loose: the least strict rules, suited to short lines such as in newspapers. Small kana (ゃ, っ and so on), the prolonged sound mark (ー), iteration marks (々), the middle dot (・) and wide symbols that follow a number, such as "%" and "℃", may start a line.
  • normal: the most common rules.
  • strict: the strictest rules.
  • anywhere: no line-breaking rules at all. A line may break between any two characters, even in the middle of an English word, and no hyphen is added.

normal versus strict

The spec only requires that, in Japanese and Chinese text, normal allows a break before "〜" (U+301C) and "゠" (U+30A0) while strict does not. Neither allows a break before small kana or the prolonged sound mark.

Earlier versions of the spec did allow those breaks with normal. Chrome (checked in version 141) still does, so it puts "ー" at the start of a line with normal and auto too.

About the preview text

The preview text is set at 15px so that, with the box 240px wide, lines end between "コ" and "ー", between "人" and "々", and between "す" and "。". With strict, "コーヒー" and "ちょっと" move to the next line; with loose, "々" starts a line; and with anywhere, even "。" does. Drag the handle at the bottom right of the box to try other widths.

Comments