white-space

Support Key: [CSS1|CSS2|CSS2.1] [IE5.5|N4B2|O4|S1]
Other Text Properties
word-spacing
letter-spacing
word-wrap
text-align
text-align-last
text-decoration
text-transform
text-shadow
text-indent
text-underline-position
= Index DOT Css by Brian Wilson =
  Main Index | Property Index | CSS Support History | Browser History  



   Quick Statistics   
Default Value:
   normal
Applicable Elements:
Block Level Elements
Inherit From Parent:
Yes
Applicable Media:
Visual
HTML Equivalent:
<pre> | <nobr>
Official Docs:
CSS1: Sect 5.6.2
CSS2: Sect 16.6, CSS2.1: Sect 16.6
What is it?
This property controls how white space and carriage returns/linefeeds should be handled in a document. 'Normal' is the inherent value for most HTML elements, with the exceptions having their own tags to create special behavior. This is a very powerful property and should be used with caution.

Allowed Values
inherit
[CSS2|CSS2.1] [N6|O4|S1]
Type: Explicit
Description:
Explicitly sets the value of this property to that of the parent.
normal
[CSS1|CSS2|CSS2.1] [IE5.5|N4B2|O4|S1]
Type: Explicit
Description:
This setting is the normal behavior of most HTML elements. Occurrences of carriage returns, linefeeds and multiple spaces are treated as a single space. Line wrapping is controlled by the browser.
pre
[CSS1|CSS2|CSS2.1] [IE5.5|N4B2|O4|S1]
Type: Explicit
Description:
This setting makes rendered content behave like the HTML PRE [-->Index DOT Html] element , where line-wrapping control is taken away from the browser and all spaces, carriage returns, and linefeeds in the document are preserved and displayed "as-is" from the source.
pre-wrap
[CSS2.1] [O7.5]
Type: Explicit
Description:
This setting behaves the same as "pre", with one exception...line-wrapping control is returned to the browser when the browser needs it (such as the browser window boundary or something similar) Tabs, multiple spaces and existing line-feeds are also honored as well. This is a new value in CSS 2.1 which I don't cover yet, but because it recognizes the need presented by -moz-pre-wrap and -o-pre-wrap (see below), I thought it would be good to start discussing it even thought the major browsers also do not support it yet.
pre-line
[CSS2.1]
Type: Explicit
Description:
This setting behaves the same as "normal", except that new line characters in the source cause line breaking in the rendered output.
-moz-pre-wrap
[N6]
Type: Explicit
Description:
This setting behaves the same as "pre", with one exception...line-wrapping control is returned to the browser when the browser needs it (such as the browser window boundary or something similar) Tabs, multiple spaces and existing line-feeds are also honored as well.
-o-pre-wrap
[O4]
Type: Explicit
Description:
This setting behaves the same as "pre", with one exception...line-wrapping control is returned to the browser when the browser needs it (such as the browser window boundary or something similar) Multiple spaces and existing line-feeds are also honored as well. Tabs are displayed as an box character (an undisplayable glyph.)
nowrap
[CSS1|CSS2|CSS2.1] [IE5.5|N6|O4|S1]
Type: Explicit
Description:
Selector content with a property value of 'nowrap' collapse multiple carriage returns/linefeeds and multiple spaces to a single space, but linebreaking is not controlled by the browser. They are instead controlled only by the HTML BR [-->Index DOT Html] element.
Example
Ext/Doc: p { white-space: normal }
In-Line:  <p STYLE="white-space: normal">text</p>
Notes Browser Peculiarities

Boring Copyright Stuff....