π What Is line-break?
The line-break property controls how text wraps in languages that use **East Asian scripts** (Chinese, Japanese, Korean β CJK). It defines how strictly the browser should follow line-breaking rules and how it handles punctuation, symbols, and special characters.
Note
β Important for CJK typography
β Has no visible effect on English-only text
π¦ Syntax
line-break syntax
line-break: auto | loose | normal | strict | anywhere;| Value | Meaning |
|---|---|
| auto | Browser decides based on language rules (default). |
| loose | Allows more break opportunities (more wrapping). |
| normal | Standard line-breaking rules. |
| strict | Very strict CJK line-breaking (fewer line breaks). |
| anywhere | Break text at any point if needed β even inside long words or before punctuation. |
π 1. Default Behavior (auto)
auto
p {
line-break: auto;
}Browser follows typical line-breaking rules for the language detected.
π 2. Allow Looser Line Breaks
loose
p {
line-break: loose;
}Adds more break opportunities β useful when dealing with narrow columns of CJK text.
π 3. Use Standard Line Break Rules
normal
p {
line-break: normal;
}A balanced option between strict and loose rules.
π 4. Apply Strict Japanese/Chinese Line Breaking
strict
p {
line-break: strict;
}Prevents breaks before characters like:!β, ? . ] ) } γ γImproves professional typesetting in Japanese/Chinese documents.
π 5. Break Text Anywhere (Even Inside Words)
anywhere
p {
line-break: anywhere;
}Break text even when rules normally forbid it. Useful for long URLs, file paths, or technical strings that overflow.
π§ͺ Real-World Use Cases
1οΈβ£ Japanese Newspaper Layout
Japanese layout
.jp-text {
line-break: strict;
}Ensures correct and readable Japanese line-breaking.
2οΈβ£ CJK Text in Very Narrow Mobile Layouts
Responsive CJK text
.mobile-text {
line-break: loose;
}3οΈβ£ Prevent Overflow of Code Snippets or URLs
break anywhere
.url {
line-break: anywhere;
word-break: break-all;
}Prevents long URLs or strings from causing horizontal scroll.
π Related Properties
- word-break β controls breaking inside words
- white-space β preserves or collapses spaces
- overflow-wrap β allows breakpoints to prevent overflow
β οΈ Common Mistakes
- β Expecting line-break to affect Latin (English) text
- β Using anywhere without considering readability
- β Confusing line-break with word-break
Note
π₯ Summary
The line-break property gives deep control over line-wrapping behavior, specifically for CJK languages. Use strict rules for professional typesetting and looser or anywhere rules for responsive, compact, or constrained layouts.
Learn more βMDN Docs π