Custom list by CSS and images

A little CSS can change the appearance of your pages by making lists attractive with graphics, at no cost.

Numbered list

The HTML code for the numbered list uses the <ol> tag:


In <li> tags, we have inserted a <p> tag in order to give the text a different style from that of the number.

So if you want to display big numbers in italic, but regular size to the text, we first redefine the <li> tags style:

#prettylist li

Then we redefine the <p> tag to return to the regular size and normal style:

#prettylist li p

The demonstration has graced the list by placing a <fieldset> with a background image, and rounded edges in some browsers.

Example of custom list with big digits...

A list with big digits on a background image inside a fieldset. The texts used here, search engines and their market shares are just examples.

  1. Google
    80% market share worldwide. Free Web applications.

  2. Bing from Microsoft
    10% market share. Highly priced desktop applications.

  3. Wolfram Alpha
    Less than 1%. Included in Bing.

  4. Alexa
    Less than 1%. Traffic comparator.

Other options

Using Roman numerals:


Using letters:


Or lowercase:


It is possible also to insert the number or the bullet inside the text, rather than put it at left:



See the W3C documentation for details.

Bullet list

Another option, for an unordered list, replace the bullets with images.

HTML code is simplified here because we can dispense with internal tags. The <ol> tag is replaced by the <ul> tag.
An identifier allows to customize the list without changing the rest of the page.

<ul id="imglist">

The CSS code simply replaces the black circle which is the default image, by our vimage example:

#imglist li 
    list-style-image: url(images/cc-ok.png);


See also other uses of lists...

Above, a practical application of upper-roman style ...

© 2010-2012