How to set up smartphones and PCs. Informational portal

Intercharacter, line spacing CSS. Distance between words

Handling spaces between letters and words

1. Spacing between words word-spacing

Sets the spacing between words. You can use positive and negative values. If the meaning is negative, the words can overlap each other.

The value of word-spacing is affected by the value of the text-align property in the case of justified text. Inherited.

Syntax

P (word-spacing: normal;) p (word-spacing: 2px;)
Rice. 1. Spacing between words

2. Letter-spacing

The property sets the distance between letters (tracking amount) and symbols. It can take positive and negative values. It is advisable to use to increase the expressiveness and readability of headings, definitions, etc. Inherited.

Syntax

P (letter-spacing: normal;) p (letter-spacing: 2px;)
Rice. 2. Change the spacing between letters using the letter-spacing property

3. White-space handling

The property handles spaces between words and line breaks within an element. Not inherited.

white space
Values:
normal Default value. Only one space is inserted between words, additional spaces are discarded. Text wraps only when needed.
nowrap Disables line breaks except when applied
.
pre Spaces in text are not ignored, the browser displays extra spaces and line breaks.
pre-wrap Preserves whitespace in text by making line breaks where necessary.
pre-line Removes extra spaces except when
.
initial Sets the value of a property to its default value.
inherit Inherits the property value from the parent element.

Syntax

P (white-space: normal;) p (white-space: nowrap;) p (white-space: pre;) p (white-space: pre-wrap;) p (white-space: pre-line;)

4. Customize tabs tab-size

To change the amount of indentation obtained with the TAB key, use the tab-size property. Property values ​​are ignored when one of the three pre-line , normal , or nowrap white-space property values ​​is set.

Only works for elements