Skip to Main Content
CSS: The Missing Manual
book

CSS: The Missing Manual

by David Sawyer McFarland
August 2006
Beginner to intermediate content levelBeginner to intermediate
496 pages
17h 36m
English
O'Reilly Media, Inc.
Content preview from CSS: The Missing Manual

List Properties

The following properties affect the formatting of bulleted lists (<ul>) and numbered lists (<ol>).

list-style (inherited)

This property is a shorthand method of specifying the three properties listed next. You can include a value for one or more of those properties, separating each by a space. You can even use this property as a shortcut for writing a single property and save a couple of keystrokes: list-style: outside, instead of list-style-position: outside. If you specify both a type and an image, a Web browser will display the bullet type (disc, square, and so on) only if it can't find the image. This way, if the path to your custom bullet image doesn't work, you don't end up with a bulletless bulleted list.

  • Values: Any valid value for list-style-type, list-style-image, and/or list-style-position.

  • Example: list-style: disc url(images/bullet.gif) inside;

list-style-image (inherited)

Specifies an image to use for a bullet in a bulleted list.

  • Values: an URL value (Section A.1.1) or none.

  • Example: list-style-image: url(images/bullet.gif);

Tip

The background-image property does the custom bullet job just as well and offers more control (see Section 8.2).

list-style-position (inherited)

Positions the bullets or numbers in a list. These markers can appear outside of the text, hanging off to the left, or inside the text (exactly where the first letter of the first line normally begins). The outside position is how Web browsers normally display bullets and numbers.

  • Values ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

CSS: The Missing Manual, 2nd Edition

CSS: The Missing Manual, 2nd Edition

David Sawyer McFarland
JavaScript: The Missing Manual

JavaScript: The Missing Manual

David Sawyer McFarland

Publisher Resources

ISBN: 0596526873Supplemental ContentErrata Page