Revision 19560 of white-space

  • Revision slug: CSS/white-space
  • Revision title: white-space
  • Revision id: 19560
  • Created:
  • Creator: Mvent2
  • Is current revision? No
  • Comment /* Notes */

Revision Content

{{ CSSRef() }}

Summary

The white-space CSS property is used to to describe how whitespace inside the element is handled.

  • {{ Xref_cssinitial() }}: {{ Cssxref("normal") }}
  • Applies to: all elements
  • {{ Xref_cssinherited() }}: yes
  • Percentages: n/a
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: as specified

Syntax

white-space: normal | pre | nowrap | pre-wrap | -moz-pre-wrap | pre-line | inherit ;

Values

{{ Cssxref("normal") }}
all sequences of whitespace and line breaks will be collapsed. Line breaks are add to wrap the content.
{{ Cssxref("pre") }}
all white spaces in the source will be preserved, lines are only broken at newline characters in the source.
{{ Cssxref("nowrap") }}
all sequences of whitespace and line breaks will be collapsed, also line breaks (text wrapping) are suppressed within content.
{{ Cssxref("pre-wrap") }} {{ Fx_minversion_inline("3") }}
all white spaces in the source will be preserved, lines are broken at newline characters and as needed to wrap the content.
{{ Cssxref("-moz-pre-wrap") }} {{ Deprecated_inline() }}
Same as pre-wrap, this is the Mozilla extension which became the CSS 2.1 pre-wrap, which should be used instead.
{{ Cssxref("pre-line") }}
all sequences of whitespace will be collapsed, lines are broken at newline characters and also as needed to wrap the content.
{{ Cssxref("inherit") }}
inherits from parent.

Examples

{{ CSSRefExampleLink("white-space") }}

code {
  white-space: pre;
}

Notes

pre-line is not implemented in Mozilla prior to Gecko 1.9.1.

Specifications

Browser compatibility

(Sample Compatibility Chart)

Browser Lowest Version
Internet Explorer 0
Firefox 0
Netscape 0
Opera 0
Safari ?


See also

{{ CSS_Reference:Text() }}


uncomment as required {{ mediawiki.internal('Category:NeedsContent', "en") }} {{ mediawiki.internal('Category:NeedsAttention', "en") }} {{ mediawiki.internal('Category:NeedsExample', "en") }} {{ mediawiki.internal('Category:NeedsImageCleanup', "en") }} {{ mediawiki.internal('Category:NeedsMarkupWork', "en") }} {{ mediawiki.internal('Category:NeedsRewrite', "en") }} {{ mediawiki.internal('Category:NeedsTechnicalReview', "en") }} {{ mediawiki.internal('Category:NeedsEditorialReview', "en") }} {{ mediawiki.internal('Category:NeedsUpdate', "en") }}

{{ languages( { "pl": "pl/CSS/white-space" } ) }}

Revision Source

<p> {{ CSSRef() }}
</p>
<h3 name="Summary"> Summary </h3>
<p>The <code>white-space</code> CSS property is used to to describe how whitespace inside the element is handled.
</p>
<ul><li> {{ Xref_cssinitial() }}: {{ Cssxref("normal") }}
</li><li> Applies to: all elements </li><li> {{ Xref_cssinherited() }}: yes
</li><li> Percentages: n/a
</li><li> Media: {{ Xref_cssvisual() }}
</li><li> {{ Xref_csscomputed() }}: as specified </li></ul>
<h3 name="Syntax"> Syntax </h3>
<pre class="eval">white-space: normal | pre | nowrap | pre-wrap | -moz-pre-wrap | pre-line | inherit ;
</pre>
<h3 name="Values"> Values </h3>
<dl><dt>{{ Cssxref("normal") }}
</dt><dd>all sequences of whitespace and line breaks will be collapsed. Line breaks are add to wrap the content.
</dd><dt>{{ Cssxref("pre") }}
</dt><dd>all white spaces in the source will be preserved, lines are only broken at newline characters in the source.
</dd><dt>{{ Cssxref("nowrap") }}
</dt><dd>all sequences of whitespace and line breaks will be collapsed, also line breaks (text wrapping) are suppressed within content.
</dd><dt>{{ Cssxref("pre-wrap") }} {{ Fx_minversion_inline("3") }}
</dt><dd>all white spaces in the source will be preserved, lines are broken at newline characters and as needed to wrap the content.
</dd><dt>{{ Cssxref("-moz-pre-wrap") }} {{ Deprecated_inline() }}
</dt><dd>Same as <code>pre-wrap</code>, this is the Mozilla extension which became the CSS 2.1 <code>pre-wrap</code>, which should be used instead.
</dd><dt>{{ Cssxref("pre-line") }}
</dt><dd>all sequences of whitespace will be collapsed, lines are broken at newline characters and also as needed to wrap the content.
</dd><dt>{{ Cssxref("inherit") }}
</dt><dd>inherits from parent.
</dd></dl>
<h3 name="Examples"> Examples </h3>
<p>{{ CSSRefExampleLink("white-space") }}
</p>
<pre class="eval">code {
  white-space: pre;
}
</pre>
<h3 name="Notes"> Notes </h3>
<p><code>pre-line</code> is not implemented in Mozilla prior to Gecko 1.9.1.
</p>
<h3 name="Specifications"> Specifications </h3>
<ul><li> <a class="external" href="http://www.w3.org/TR/CSS21/text.html#white-space-prop">CSS 2.1 text</a> </li><li> <a class="external" href="http://www.w3.org/TR/CSS1#white-space">CSS 1</a>
</li><li> <a class="external" href="http://www.w3.org/TR/css3-text/#white-space-summary">CSS 3</a>
</li></ul>
<h3 name="Browser_compatibility"> Browser compatibility </h3>
<p>(Sample Compatibility Chart)
</p>
<table class="standard-table"> <tbody><tr> <th>Browser</th> <th>Lowest Version</th> </tr> <tr> <td>Internet Explorer</td> <td>0</td> </tr> <tr> <td>Firefox</td> <td>0</td> </tr> <tr> <td>Netscape</td> <td>0</td> </tr> <tr> <td>Opera</td> <td>0</td> </tr> <tr> <td>Safari</td> <td>?</td> </tr>
</tbody></table>
<p><br>
</p>
<h3 name="See_also"> See also </h3>
<p>{{ CSS_Reference:Text() }}
</p><p><br>
<span class="comment">uncomment as required {{ mediawiki.internal('Category:NeedsContent', "en") }} {{ mediawiki.internal('Category:NeedsAttention', "en") }} {{ mediawiki.internal('Category:NeedsExample', "en") }} {{ mediawiki.internal('Category:NeedsImageCleanup', "en") }} {{ mediawiki.internal('Category:NeedsMarkupWork', "en") }} {{ mediawiki.internal('Category:NeedsRewrite', "en") }} {{ mediawiki.internal('Category:NeedsTechnicalReview', "en") }} {{ mediawiki.internal('Category:NeedsEditorialReview', "en") }} {{ mediawiki.internal('Category:NeedsUpdate', "en") }}</span>
</p>
<div class="noinclude">
</div>
{{ languages( { "pl": "pl/CSS/white-space" } ) }}
Revert to this revision