Extensible HyperText Markup Language

XHTML.com recommends: PSD to HTML Slicing Service and PSD to HTML by W3 Markup. see your link here

white-space

Definition

The white-space property specifies how whitespace (spaces, tabs and hard returns) inside an element is handled. For example, a fixed width table may wrap text in table headings as show in the screen shot below.

Screen shot of a Web browser showing a table with text in table headings wrapping.

Applying the white-space property with the value nowrap to the table headers (th), will instruct Web browser not to wrap text in table headers as shown in the screen shot below.

Screen shot of a Web browser showing a table with text in table headers not wrapping.

In XHTML, whitespace is collapsed. This means that multiple consecutive whitespace characters (spaces, tabs and hard returns) will be treated as a single space character. The white-space property can instruct Web browsers to change this behavior.

Example

  1. th {white-space: nowrap}

Characteristics

Possible values

normal
Collapse whitespace.
pre
Preserve whitespace.
nowrap
Same as normal but suppresses line breaks.
pre-wrap
Preserve whitespace but wrap text.
pre-line
Collapse whitespace but preserve line breaks.
inherit
Use the same computed value as the parent element for this property.

Default value

normal

Applies to

All elements

Inherited

Yes