revision:
- specifies how words should break when reaching the end of a line.
Property values:
normal : default value. Uses default line break rules
break-all : to prevent overflow, word may be broken at any character
keep-all : word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as value "normal"
break-word : to prevent overflow, word may be broken at arbitrary points
initial : sets this property to its default value.
inherit : inherits this property from its parent element.
Thisissomeveryveryverylong word. Words will break according to usual rules.
Thisissomeveryveryverylong word. This text will-break-at-hyphens.
Thisissomeveryveryverylong word. This text will break at any character.
<div> <h4>word-break: normal (default):</h4> <p class="all Word-A">Thisissomeveryveryverylong word. Words will break according to usual rules.</p> <h4>word-break: keep-all:</h4> <p class="all Word-B">Thisissomeveryveryverylong word. This text will-break-at-hyphens.</p> <h4>word-break: break-all:</h4> <p class="all Word-C">Thisissomeveryveryverylong word. This text will break at any character.</p> </div> <style> p.all {width: 10vw; border: 0.1vw solid #000000;} p.Word-A {word-break: normal;} p.Word-B {word-break: keep-all;} p.Word-C {word-break: break-all;} </style>
- increases or decreases the white space between words. Negative values are allowed.
Property values:
normal : defines normal space between words (0.25em). This is default
length : defines an additional space between words (in px, pt, cm, em, etc). Negative values are allowed.
initial : sets this property to its default value.
inherit : inherits this property from its parent element.
This is some text. This is some text.
This is some text. This is some text.
This is some text. This is some text
<div> <h4>word-spacing: normal (default):</h4> <p class="Word-D">This is some text. This is some text.</p> <h4>word-spacing: 3vw:</h4> <p class="Word-E">This is some text. This is some text.</p> <h4>word-spacing: 1cm:</h4> <p class="Word-F">This is some text. This is some text</p> </div> <style> p.Word-D {word-spacing: normal;} p.Word-E {word-spacing: 3vw;} p.Word-F {word-spacing: 1cm;} </style>
- allows long words to be able to be broken and wrap onto the next line.
Property values:
normal : break words only at allowed break points. This is default
break-word : allows unbreakable words to be broken
initial : sets this property to its default value.
inherit : inherits this property from its parent element.
This div contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will not break and wrap to the next line.
This div contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.
<div> <h4>word-wrap: normal (default):</h4> <p class="all-1 Word-G">This div contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will not break and wrap to the next line.</p> <h4>word-wrap: break-word:</h4> <p class="all-1 Word-H">This div contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.</p> </div> <style> p.all-1 {width: 15vw; border: 0.2vw solid black;} p.Word-G {word-wrap: normal;} p.Word-H {word-wrap: break-word;} </style>