Menu Samaritan's Purse

WHITE-SPACE

The white-space property 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

BREAK-SPACES

NORMAL

NOWRAP

PRE

PRE-LINE

PRE-WRAP

JS

World Wide Web Consortium (W3C)