Internet Windows Android

Word hyphenation in HTML. Word hyphenation What is the difference between one property and another

The white-space property sets how to display spaces between words. Under normal circumstances, any number of spaces in HTML code appear as one on a web page. The exception is the element

, the text placed in this container is displayed with all spaces, as it was formatted by the user.  Thus, white-space mimics work 
But unlike it, it does not change the font to monospaced.

short info

Designations

DescriptionExample
<тип> Indicates the type of value.<размер>
A && BThe values ​​must be displayed in the order shown.<размер> && <цвет>
A | BIndicates that only one of the suggested values ​​should be selected (A or B).normal | small-caps
A || BEach value can be used alone or in conjunction with others in any order.width || count
Groups values.[crop || cross]
* Repeat zero or more times.[,<время>]*
+ Repeat one or more times.<число>+
? The specified type, word or group is optional.inset?
(A, B)Repeat at least A, but no more than B times.<радиус>{1,4}
# Repeat one or more times, separated by commas.<время>#
×

The values

normal Text is displayed in the browser window as usual, line breaks are set automatically. nowrap Spaces are ignored, line breaks in HTML code are ignored, all text is displayed on one line; however, adding
wraps the text to a new line. pre The text is shown including all spaces and hyphens as they were added by the developer in the HTML code. If the line is too long to fit in the browser window, a horizontal scroll bar will be added. pre-line Spaces are not counted in the text, the text is automatically wrapped to the next line if it does not fit into the specified area. pre-wrap All spaces and breaks are preserved in the text, but if the line width does not fit into the specified area, the text will automatically wrap to the next line.

The effect of the values ​​on the text is presented in table. 1.

Example

white-space

Example

Fermat's Last Theorem
X n+ Y n= Z n
where n is an integer> 2

The result of this example is shown in Fig. 1.

Rice. 1. Applying the white-space property

Object Model

An object.style.whiteSpace

Note

Internet Explorer up to and including 7.0 does not support pre-line and pre-wrap values. For