PDA

View Full Version : Ordered Lists


Blaze
08-22-2002, 08:07 PM
Here's a good question.
I do not believe an ordered list value is even around to allow me to do this (see examples)... but hey I could be wrong ;)


i.e.
<ol type="a">
<li>Star</li>
<li>Moon</li>
<li>Sun</li>
<li>Earth</li>
</ol>

As you can see, it's listed with the a, b etc appearance. I am wondering if it's possible to have ")" after the a?
Like:
a) Star
etc.

<ol type="a)">
<li>Star</li>
</ol>

I tried this, and the default of 1 was used. :p
Help?

Thankies :D

jkd
08-22-2002, 08:29 PM
This is where CSS would be used:


li {
counter-increment: li-num;
}
ol, ul {
counter-reset: li-num;
list-style-type: none;
}
li:before {
content: counter(li-num) ") "
}


There is only one browser that supports counters though, and believe it or not, it is Opera 6. I can't seem to make counters work in the generally more compliant Mozilla web browser.

Blaze
08-22-2002, 08:46 PM
It seems there just might be another way to do what I needed... but in other ways then just keeping it simply done.. ;P

Well, thank you very much for you help. But I also don't wanna worry about browser diff's either. I wish they'd pick a universal browser :mad: :) but can't have everything now can we?

Ciao

starglow
08-22-2002, 09:00 PM
you could just write the a) b) etc yourself and then blockquote it like this

<blockquote>
a) Star<br>
b) Moon<br>
c) Sun<br>
d) Earth
</blockquote>

jkd
08-22-2002, 09:11 PM
Hmm, it seems counters were removed in CSS 2.1, I wonder why...

Blaze
08-23-2002, 01:00 AM
I was thinking about your suggestion already Starglow, thanks however for reminding me ;) But it turns out they don't care if I use the ")" or not :p

Thanks everyone for your great help :)