List-Style-Type
Now we get into the fun of this command. The list-style-type command allows you to set the entire list, or just one element, to a specific type. You've done this before in HTML by adding TYPE="--" to the main <UL> or <OL> flag. Here, you're offered a little more freedom. Let's take a look at the Unordered List styles first:
<UL STYLE="list-style-type: square">
<LI> List Item
<LI> List Item
<LI> List Item
</UL>
...and this is what you get:
- List Item
- List Item
- List Item
There are actually three types to choose from: circle, square, and disc. Here are all three:
<UL>
<LI STYLE="list-style-type: circle"> List Item
<LI STYLE="list-style-type: square"> List Item
<LI STYLE="list-style-type: disc"> List Item
</UL>
...and this is what you get:
- List Item
- List Item
- List Item
But what about those Ordered Lists? Well, you get a few more choices there: decimal, lower-alpha, upper-alpha, lower-roman, and upper-Roman. You can pretty much guess what each looks like, but because I'm a cut-and-paste fool, here's what it all looks like:
<OL>
<LI STYLE="list-style-type: decimal"> List Item
<LI STYLE="list-style-type: lower-alpha"> List Item
<LI STYLE="list-style-type: upper-alpha"> List Item
<LI STYLE="list-style-type: lower-roman"> List Item
<LI STYLE="list-style-type: upper-roman"> List Item
</OL>
...and this is what you get:
- List Item
- List Item
- List Item
- List Item
- List Item
And just to drive the point home:
- decimal: basic 1, 2, 3, counting
- lower-alpha: lowercase letters
- upper-alpha: uppercase letters
- lower-roman: lowercase Roman numerals
- upper-roman: uppercase Roman numerals
The command is good for <OL>, <UL> (changes bullets to numbers/letters), <LI>, <DD>, and <DT> flags.
List-Style
Tired of writing all those list-item types? Do you want something that does it all for you? Well, search no more. The list-item catch-all command is for you! You may not have noticed above, but none of the attributes across all of the list-item-something commands were equal. That means if you use "circle" or "inside" the browser knows you mean a specific list-item type. Thus, you only need this one list-item command.
Let's say I want a list with uppercase Roman numerals and wrapping text to sit outside of the Roman number. I could set both a list-style-position and a list-item-type, but why? There's no need. Use the basic list-style command and the browser will know what you mean from the attribute. Like so:
<OL STYLE="list-style: upper-roman outside">
<LI> List Item
<LI> List Item
<LI> List Item
</OL>
...and this is what you get:
- List Item
- List Item
- List Item
That's That
As with any CSS command, your browser may not support it just yet. If so, keep the commands in your back pocket and use them anyway. Those browsers that do understand the commands will display them; those that do not will ignore the commands and no one will be the worse for it.
[List-Style-Image] [List-Style-Position]
[List-Style-Type] [List-Style]
Enjoy!