1. Home
  2. Computing & Technology
  3. Web Design / HTML

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:

Return to the Style Library

Explore Web Design / HTML
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Style Properties
  6. CSS Style Property: white-space>

©2010 About.com, a part of The New York Times Company.

All rights reserved.