CSS list style type
January 5th, 2006 by Sonja DuijvesteijnWith css you get the ability to style your lists better than you could before. And example of that would be the dropdown menu’s that can be made with css (usually done with lists), but most people forget about the use of different styles for lists items.
Traditionally used is the disc, a small black circle.
However there is no reason to limit yourself to that. You can use:
Hebrew
- list item 1
- list item 2
- list item 3
Georgian
- list item 1
- list item 2
- list item 3
Lower-greek
- list item 1
- list item 2
- list item 3
When would you use it you might wonder? Good question, probably not, but it’s good to know you can, if you need it.
The real question is however, why does the <ol> and <ul> still excist? In my opinion they should be replaced with a general <list>. According to the W3C an ordered list should contain information where order should be emphasized. However, with css this can be accomplished as well, and css should be used to style data. In my opinion adding emphasis is styling the data, and thus should be done by the css.
There is a third type of list as well, the definition list.
<dl>
<dt>Dweeb</dt>
<dd>young excitable person who may mature into a <EM>Nerd</EM> or <EM>Geek</EM></dd>
<dt>Hacker</dt>
<dd>a clever programmer</dd>
<dt>Nerd</dt>
<dd>technically bright person</dd>
</dl>
Which gives the following result:
- Dweeb
- young excitable person who may mature into a Nerd or Geek
- Hacker
- a clever programmer
- Nerd
- technically bright person
Now when’s the last time you’ve used a definition list?
Related posts
CSS 2 Attribute selectors
CSS 3 selectors
More CSS
Internet Explorer 7
Flash and search engines