HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

white-space

Description

The white-space property for CSS specifies whether and how white space inside the element is collapsed and whether lines may wrap at unforced soft wrap opportunities.

Syntax

CSS

white-space: value;

JS

object.style.whiteSpace = "value";

Values

<'white-space'> = normal | pre | nowrap | pre-wrap | break-spaces | pre-line
normal

This value directs user agents to collapse sequences of white space into a single character.

pre

This value prevents user agents from collapsing sequences of white space.

nowrap

Like normal, this value collapses white space; but like pre, it does not allow wrapping.

pre-wrap

Like pre, this value preserves white space; but like normal, it allows wrapping.

break-spaces

The behavior is identical to that of pre-wrap, except that: any sequence of preserved white space or other space separators always takes up space, including at the end of the line and a line breaking opportunity exists after every preserved white space character and after every other space separator.

pre-line

Like normal, this value collapses consecutive white space characters and allows wrapping, but preserves segment breaks in the source as forced line breaks.

Initial

normal

Examples

1 · break-spaces

2 · normal

3 · nowrap

4 · pre

5 · pre-line

6 · pre-wrap

7 · JS