demosthenes.info

A blog by Dudley Storey on , , , , , , and anything else that strikes his fancy.

featured articles

popular favourites

list-style-type in CSS 1 & 2

The easiest alteration to make to HTML lists is to change the value of list-style-type. (Note that list-style is a different property; the two are often confused). Under CSS Levels 1 and 2, the choices for list-style-type are fairly limited. The options are significantly expanded in CSS3, but as a rule the values are not (as of this writing) fully supported, even in the most recent browser versions.

For unordered lists the choices are none, inherit, circle, disc, or square. (disc is the default; nested unordered lists will use circle and square for decoration, in that order, the deeper they are nested. inherit simply means that the affected list will take the list-style-type of its parent.). Note that setting the list-style-type to none does not remove the indent on the list – in most browsers, that is controlled by margin-left.

For ordered lists the choices are quite a bit more varied. Aside from the aforementioned none and inherit, there is also:

List-style-type values in CSS Levels 1 & 2 (Examples are displayed inline to save space)
valuedescriptionexample
armenianArmenian numbering
cjk-ideographicChinese, Japanese, Korean and Vietnamese shared numbering system
decimalDecimal number; the default.
decimal-leading-zeroDecimal numbers starting with a 0
georgianGeorgian numbering
hebrewTraditional Hebrew numbering
hiraganaJapanese numbering system, for values not covered by kanji
hiragana-irohaTraditional pronounced Japanese numbering system
katakanaJapanese numbering system, a derivation of kanji
katakana-irohaTraditional variation of katakana.
lower-alpha / lower-latinAlphabetical, lowercase
lower-greekGreek (alpha, beta, gamma) lowercase
lower-romanRoman numbering, lowecase
upper-alpha / upper-latinAlphabetical, uppercase
upper-romanRoman numbering, uppercase

The most important aspect to note about all of these options is that the markup of the ordered list does not change: you create the code for the list as normal, and make any changes to the way they are displayed by altering the CSS.

IE6 does not display “non-English” counting systems, nor does it support decimal-leading-zero. All other browsers are fine with the systems above.

web developer guide

featured comment

by JoelB in Goodbye, JQuery Validation: HTML5 Form Errors With CSS3

what i'm reading

A Storm of Swords: A Song of Ice and Fire: Book Three
A Storm of Swords: A Song of Ice and Fire: Book Three

what i'm watching

Californication: The Third Season
Californication: The Third Season

what i'm playing

Mass Effect 3 Collector's Edition
Mass Effect 3 Collector's Edition

what i'm hearing

Dub FX
Dub FX

blogs

podcasts

no ads ever

This blog is free of advertising, and always will be.

creative commons licensed

The content of this blog is free to use in whatever way you wish under the Creative Commons license.