white-space Description:
The white-space property defines how white space within the element is treated.
white-space in CSS Versions:
white-space Syntax:
white-space: normal | pre | nowrap | pre-wrap | pre-line | inherit
- normal
Collapse white space as usually happens in HTML documents. - pre
Treat white space within elements as the <pre></pre> tag does. - nowrap
Force wrapping only through the use of <br /> elements. - pre-wrap
Prevents user agents from collapsing white space. - pre-line
This value directs user agents to collapse sequences of white space. - inherit
The element should have the same white-space setting as the parent.
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.

