1. Computing

Discuss in my forum

white-space

By , About.com Guide

white-space Description:

The white-space property defines how whitespace within the element is treated.

white-space in CSS Versions:

white-space Syntax:

white-space: normal | pre | nowrap

  • normal
    Collapse whitespace as usually happens in HTML documents.
  • pre
    Treat whitespace within elements as the <pre></pre> tag does.
  • nowrap
    Force wrapping only through the use of <br /> elements.

white-space Initial Value:

normal

white-space Applies To:

All block-level elements.

white-space Inheritance:

This property is inherited.

white-space Browser Support:

white-space Examples:

display as pre-formatted text

<p style="white-space: pre;">
 This paragraph
 will look pre-formatted.
 </p>

white-space Special Notes:

  • Be careful using nowrap, as you can end up with really long strings of text that can play havoc with your design.
  • In CSS1 core, user-agents may ignore the white-space property and use default values instead.

More white-space Information:

©2013 About.com. All rights reserved.