CSS3 word-break Property ------------------------ Example Break words between any two letters: p.test { word-break: break-all; } Definition and Usage The word-break property specifies line breaking rules for non-CJK scripts. Tip: CJK scripts are Chinese, Japanese and Korean ("CJK") scripts. Default value: normal Inherited: yes Animatable: no. Read about animatable Version: CSS3 JavaScript syntax: object.style.wordBreak="break-all" Browser Support The numbers in the table specify the first browser version that fully supports the property. Property word-break 4.0 5.5 15.0 3.1 15.0 CSS Syntax word-break: normal|break-all|keep-all|initial|inherit; Property Values Value Description normal Default value. Break words according to their usual rules break-all Lines may break between any two letters keep-all Breaks are prohibited between pairs of letters initial Sets this property to its default value. Read about initial inherit Inherits this property from its parent element. Read about inherit
This paragraph contains some text. This line will-break-at-hyphens.
This paragraph contains some text. The lines will break at any character.
Note: The word-break property is not supported in Opera 12 and earlier versions.
CSS word-spacing Property ------------------------- Example Specify that the space between words inelements should be 30 pixels: p { word-spacing: 30px; } Definition and Usage The word-spacing property increases or decreases the white space between words. Note: Negative values are allowed. Default value: normal Inherited: yes Animatable: yes. Read about animatable Version: CSS1 JavaScript syntax: object.style.wordSpacing="20px" Browser Support The numbers in the table specify the first browser version that fully supports the property. Property word-spacing 1.0 6.0 1.0 1.0 3.5 CSS Syntax word-spacing: normal|length|initial|inherit; Property Values Value Description Play it 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. Read about initial inherit Inherits this property from its parent element. Read about inherit
This is some text. This is some text.
CSS3 word-wrap Property ----------------------- Example Allow long words to be able to break and wrap onto the next line: p.test { word-wrap: break-word; } Definition and Usage The word-wrap property allows long words to be able to be broken and wrap onto the next line. Default value: normal Inherited: yes Animatable: no. Read about animatable Version: CSS3 JavaScript syntax: object.style.wordWrap="break-word" Browser Support The numbers in the table specify the first browser version that fully supports the property. Property word-wrap 4.0 5.5 3.5 3.1 10.5 CSS Syntax word-wrap: normal|break-word|initial|inherit; Property Values Value Description normal Break words only at allowed break points break-word Allows unbreakable words to be broken initial Sets this property to its default value. Read about initial inherit Inherits this property from its parent element. Read about inheritThis paragraph contains a very long word: thisisaveryveryveryveryveryverylongword. The long word will break and wrap to the next line.
CSS white-space Property ------------------------ Example Specify that the text in elements will never wrap:
p {
white-space: nowrap;
}
Definition and Usage
The white-space property specifies how white-space inside an element is handled.
Default value: normal
Inherited: yes
Animatable: no. Read about animatable
Version: CSS1
JavaScript syntax: object.style.whiteSpace="nowrap"
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property
white-space 1.0 8.0 3.5 3.0 9.5
CSS Syntax
white-space: normal|nowrap|pre|pre-line|pre-wrap|initial|inherit;
Property Values
Value Description Play it
normal Sequences of whitespace will collapse into a single whitespace. Text will wrap when necessary. This is default
nowrap Sequences of whitespace will collapse into a single whitespace. Text will never wrap to the next line. The text continues on the same line until a
tag is encountered
pre Whitespace is preserved by the browser. Text will only wrap on line breaks. Acts like the
tag in HTML pre-line Sequences of whitespace will collapse into a single whitespace. Text will wrap when necessary, and on line breaks pre-wrap Whitespace is preserved by the browser. Text will wrap when necessary, and on line breaks initial Sets this property to its default value. Read about initial inherit Inherits this property from its parent element. Read about inheritThis is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.