HTML and CSS Reference
In-Depth Information
<p> List below not displaying as such </p>
<li> Item </li>
<li> Item </li>
<li> Item </li>
The display property shows us just how far CSS can go in affecting markup. This
powerful property can produce quite elegant results, such as navigation menus, as we shall
see in numerous examples in the topic. It is also mandatory when attempting to style XML
elements with no predefined rendering. However, this power can come with a price of
confusion when misapplied.
Controlling White Space
The white-space property controls how spaces, tabs, and newline characters are handled in
an element. The default value, “normal,” collapses whitespace characters into a single space
and automatically wraps lines, just as it normally would in an (X)HTML document. When a
value of “pre” is used for the property, whitespace formatting is preserved, similar to how the
<pre> tag works in (X)HTML. The “nowrap” value prevents lines from wrapping if they
exceed the element's content width. This simple example demonstrates how the white-space
property works, the rendering of which is shown in Figure 4-12.
F IGURE 4-12 Whitespace handling controlled by CSS
Search WWH ::

Custom Search