Setting All List-Style Properties at Once

CSS has a shortcut property for the list-style features.

To set all the list-style properties at once:


Type list-style:


If desired, specify the kind of markers that should appear next to the list items, if any (as described on page 218).


If desired, specify the custom marker that should be used for list items (as described on page 220).


If desired, specify whether markers should be hung outside the list paragraphs or flush with the text (as described on page 221).


  • You may specify any or all of the three list-style properties.

  • You might think that by omitting one of the three properties, you won't be affecting it, but that's not always the case. Any properties not explicitly set are returned to their defaults (disc for list-style-type, none for list-style-image, and outside for list-style-position).

  • The properties may be specified in any order.

  • The list-style property is inherited.

Figure 15.16. This style rule is equivalent to setting the list-style-image to the right-arrow.gif file, the list-style-position to inside and the list-style-type to square. It's just shorter.

Figure 15.17. As long as the image is available, the result is the same as in Figure 15.15 on page 221.

Figure 15.18. If the image is not available, the square is used.

HTML, XHTML, & CSS(c) Visual QuickStart Guide
HTML, XHTML, and CSS, Sixth Edition
ISBN: 0321430840
EAN: 2147483647
Year: 2004
Pages: 340

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: