ul to ol

J

Jeff Thies

Is it possible to change a unordered list to "appear" as an ordered
list. Or perhaps vice versa. Perhaps a list-style setting?

I've switched over to ThunderBird and this is my first post with it.
Hope it goes well...

Jeff
 
E

Els

Jeff said:
Is it possible to change a unordered list to "appear" as an
ordered list.

Not that I know of.
Or perhaps vice versa. Perhaps a list-style
setting?

Haven't tried, but list-style:none might take out the numbers,
thus leaving it unordered, but without bullets either.

Why don't you just change the ol to ul or ul to ol? Seems the
best and simplest method.
I've switched over to ThunderBird and this is my first post
with it. Hope it goes well...

Yep, went well.
 
B

brucie

in post: <
Jeff Thies said:
Is it possible to change a unordered list to "appear" as an ordered
list. Or perhaps vice versa. Perhaps a list-style setting?

yes but why not just change the <ul> to <ol>?

ul{list-style-type:none;}
li:before {content:counter(blah)". ";counter-increment:blah 1;}

will display

<ul>
<li>blah
<li>blah
<li>blah
<ul>

like this:

1. blah
2. blah
3. blah

supported by opera 6+ (maybe 5 but i cant find my copy to test)
 
L

Leif K-Brooks

brucie said:
ul{list-style-type:none;}
li:before {content:counter(blah)". ";counter-increment:blah 1;}

What's wrong with this?

ul {list-style-type: decimal}
 
J

Jukka K. Korpela

brucie said:
in post: <


nothing they just number <li>s differently, it depends how you want
them.

They are rather different approaches, and the latter is far more widely
supported; IE does not understand generated content (like :before pseudo-
elements and counters) at all.

You could assign other values to list-style-type as well, e.g.
list-type-type: lower-roman
to get the numberin i, ii, iii etc.

But generally I agree with the comment that you should <ol> markup if you
want to have the items automatically numbered. Although the difference
between <ul> and <ol> might be seen as presentational only, it is more
natural to treat it as "semi-structural" (in many cases at least).
 
J

Jeff Thies

Jukka said:
They are rather different approaches, and the latter is far more widely
supported; IE does not understand generated content (like :before pseudo-
elements and counters) at all.

You could assign other values to list-style-type as well, e.g.
list-type-type: lower-roman
to get the numberin i, ii, iii etc.

But generally I agree with the comment that you should <ol> markup if you
want to have the items automatically numbered. Although the difference
between <ul> and <ol> might be seen as presentational only, it is more
natural to treat it as "semi-structural" (in many cases at least).
I've only come up with a couple of structural uses for ol:

David Lettermans Top 10 list (not sure if that crosses the pond)
Step by step instructions (which usually are so complex they often
aren't in lists)

There may be others, but it seems that unordered lists usually suffice.

I haven't decided yet whether it is worth the option of switching
between ol and ul (CMS) when altering styles is so easy. So far I've had
no one ask for numbered lists in place of the unordered I've offered.

Cheers,
Jeff
 
T

Toby A Inkster

Jeff said:
David Lettermans Top 10 list (not sure if that crosses the pond)

Or indeed any list where order is important (duh): top 40 album chart; top
20 browsers in a log file.

Or any list where you need to refer back to specific items later. e.g.:

Rules of Cricket.
1. If you hit the ball and it is caught, you are out.
2. If the ball hits the wicket, you are out.
3. If the ball hits your leg, you are out.
4. If the ball bounces before it is caught, rule #1 is not observed.
5. If your leg is not in front of the wicket, rule #3 is not observed.
6. To score a "run" you have to run from one crease to the other.
7. If you hit the ball to the boundary, rule #6 no longer applies and you
get 4 runs.
8. If you hit the ball to the boundary without a bounce, rules #6 and #7
can be ignored and you get 6 runs.
9. A crease (see rule #6) is a line one and a half bats length from a
wicket in the direction of the other wicket.
10. etc...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top