HTML and CSS Reference
In-Depth Information
However, this distinction may not matter when an appropriate
z-index
value has made
the hidden object.
• This property is commonly used with JavaScript to show/hide an element or
perform certain dynamic effects.
• The CSS2 specification introduced the
collapse
value for this property for use
with table rows and columns to collapse cells. When the value is used on other
elements it should act like the value of
hidden
.
white-space
This property controls how spaces, tabs, and newline characters are handled in an element.
Syntax
white-space: normal | pre | nowrap | pre-wrap | pre-line | inherit
The
normal
value collapses multiple whitespace characters into single spaces and
automatically wraps lines, as in normal HTML/XHTML. The
pre
value makes the element
act much like a
<pre>
tag and preserves all white space. The value of
nowrap
prevents lines
from wrapping if they exceed the element's content width. The value of
pre-line
collapses
white space, save newlines, which are preserved. The value of
pre-wrap
breaks newlines
that would cause text to break out of an element's box; otherwise, it acts like a
pre
value.
Examples
p {white-space: pre;}
pre {white-space: normal;} /* change pre a bad idea */
.sourcecode {white-space: nowrap;}
.lovereturns {white-space: pre-line;}
Compatibility
CSS 1, 2, 3 IE 4+ Netscape 4+ (partial), Firefox 1+ Opera 4+, Safari 1+
Note
• The values of
pre-wrap
and
pre-line
are not supported in older browsers.
widows
This property defines the minimum number of lines in a paragraph to be left at the top of
a page.
Syntax
widows:
integer
| inherit