Example

A simple white-space property example:

Laboratory

description & Usage

To manage white and empty space in an element, we use the white-space property.

Informations

# Description
Default Value normal
Inherited yes
Animatable no
Version CSS1
JavaScript syntax object.style.whiteSpace="nowrap"

Browser compatibility and Support

# Chrome Edge Firefox Safari Opera
white-space

Syntax

Values

Values Description
normal default
nowrap The text continues on one line until it encounters the <br> tag and continues on the next line.
pre Like the <pre> tag in html, the text closes only at line breaks.
pre-wrap It causes the empty space to be managed by the browser and the text ends on the next line in the appropriate place.
initial Adds this value to its default property.
inherit It inherits this value from its parent tag.