White Spacing in CSS
The white-space Property
The white-space property specifies how white space inside an element is handled. Its values can be set to normal, inherit, nowrap, pre, pre-line, pre-wrap, etc
Syntax:-
Its syntax is:-
< style >
element{
white-space: normal| nowrap| pre| pre-line| pre-wrap| initial| inherit;
}
< /style >
Further Explanation:-
Value | Description |
---|---|
normal | Sequences of whitespace will collapse into a single whitespace. Text will be wrapped when necessary. |
nowrap | Sequences of whitespace will collapse into a single whitespace. Text will never wrap to the next line until be tag is encountered. |
pre | Whitespace is preserved by the browser. Text will only wrap on line breaks. |
pre-line | Sequences of whitespace will collapse into single whitespace and will wrap when necessary and on line breaks |
pre-wrap | Whitespace is preserved by the browser and text will wrap when necessary and on line breaks |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |