Openwave Mobile Browser 6.1 and 6.2: XHTML Mobile Profile and CSS Reference

Section 28 out of 38 total sections
Current chapter: CSS Reference

List Properties

You can use the list properties to set rules for bulleting, numbering, and indenting of ordered and unordered lists, and for the definitions in definition lists (<dd> elements contained in <dl> elements).



list-style-type

Declares the type of bullets or numbers in an unordered or ordered list.

NOTE  This property ignores whether the selected list item is a member of an ordered or unordered list. For example, you can use this property to number list items in an unordered list. Prevent this effect by taking care with your selectors, most simply by creating rules that apply the list-style-property to the <ol> or <ul> elements, rather than to <li> element directly.

Values

disc, circle, square, decimal, lower-roman, upper-roman, lower-alpha, upper-alpha, none, inherit

Default Value

disc for unordered lists, decimal for ordered lists, none for definition lists.

Useful For

Elements in ordered (<ol>) and unordered (<ul>) lists, and definition (<dd>) elements in definition lists (<dl>).

Inherited

Yes.

Notes

The values have the following effect:

Numbered lists start with 1 unless you set a different starting number, as described in <li> and <ol>.

The list-style-type property ignores whether affected items are part of an ordered, unordered, or definition list. Avoid setting a style rule for all <li> elements. Apply list-style-type to <ol>, <ul>, or <dl>, or use descendant selectors or a similar technique.

Example
ul {list-style-type: square}

Use square bullets before items in unordered lists.



list-style-position

Specifies how text in a list item wraps when it doesn't fit on one line. The outside value causes the second and following lines of a list item to wrap to the right of the item's bullet or number (a "hanging indent"); the inside value causes the text to align with the left side of the bullet or number.

Values

inside, outside, inherit

Default Value

outside

Useful For

Elements in ordered (<ol>) and unordered (<ul>) lists, and definition (<dd>) elements in definition lists (<dl>).

Inherited

Yes.

Example
ul {list-style-postion: inside}

Sets the bullet and the second and subsequent lines of text flush left.



list-style-image

Sets an image to be used as the bullet in a list.

Values

URL, none, inherit

See URLs and Keywords for more information.

Default Value

none

Useful For

Elements in ordered (<ol>) and unordered (<ul>) lists, and definition (<dd>) elements in definition lists (<dl>).

Inherited

Yes.

Notes

URLs includes information on how to take advantage of the Openwave icons and WAP pictograms included with the browser as background images.

Example
ul {list-style-image: localsrc("bird")}

Sets the Openwave bird icon as the bullet for items in unordered lists.



list-style

A shorthand property that sets the list-style-type, list-style-position, and list-style-image properties.

Values

See the values for list-style-type, list-style-position, and list-style-image.

Default Value

None.

Useful For

Elements in ordered (<ol>) and unordered (<ul>) lists, and definition (<dd>) elements in definition lists (<dl>).

Inherited

Yes.

Notes

Because they share no common values, you can use the list-style-type, list-style-position, and list-style-image values in any order.

Example
ol {list-style: lower-alpha inside}

Uses lowercase letters before the items in orders lists, without a hanging indent.