By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,842 Members | 2,186 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,842 IT Pros & Developers. It's quick & easy.

Offset list numbering in XHTML Strict?

P: n/a
Hello,

how do I offset the numbering of a list in XHTML Strict (+CSS) in
current browsers?

What I want is something like:

5. Item a
6. Item b
7. Item c

i.e. list numbering for the items within an <ol> starts at the value 5.
I cannot use the 'start' attribute on <ol>, since that is not available
in XHTML Strict.

Is there a way to do this, probably using CSS?

Regards, Christian.
--
Christian Roth
Email: roth (at) visualclick (dot) de
Mac.Java.Pasta.Sopranosax.Single.
Jul 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
in comp.infosystems.www.authoring.stylesheets, Christian Roth wrote:
Hello,

how do I offset the numbering of a list in XHTML Strict (+CSS) in
current browsers? i.e. list numbering for the items within an <ol> starts at the value 5. Is there a way to do this, probably using CSS?


Yes, counters in CSS2. Work on Opera, and Only Opera.

Best aproach with strict and CSS is usually use ul and add numbers on
content. Some discussion about this few days ago here:
http://groups.google.com/groups?&thr...91558@trndny08

Transitional is worth considering as well. There is no support for CSS
alternative, so it is legitime use of deprecated code.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Jul 21 '05 #2

P: n/a
Christian Roth wrote:
Hello,

how do I offset the numbering of a list in XHTML Strict (+CSS) in
current browsers?

What I want is something like:

5. Item a
6. Item b
7. Item c

i.e. list numbering for the items within an <ol> starts at the value 5.
I cannot use the 'start' attribute on <ol>, since that is not available
in XHTML Strict.

Is there a way to do this, probably using CSS?
Regards, Christian.


This is the only way I've seen it done:

<ol start="5">
<li>Item a</li>
<li>Item b</li>
<li>Item c</li>
</ol>

Mike
Jul 21 '05 #3

P: n/a
Lauri Raittila <la***@raittila.cjb.net> wrote:
Yes, counters in CSS2. Work on Opera, and Only Opera.


I've found this out also, though I did not yet manage to get a different
numbering than

5
Item a

6
Item b

in Opera instead of

5 Item a
6 Item b

Unfortunately, even this numbering I was not yet able to write with the
code falling back gracefully on non-counter-aware browsers (i.e. getting
a number there - I had to use "list-style-type: none" on Opera to not
get double-numbering), so I won't be able to use it.

Thanks for the recent discussion pointer - when I searched on Google, it
seems I did not get the search terms right as this one did not show up.

At least I now know that, err, it simply cannot be done cross-browser in
XHTML Strict (unfortunately a requirement here). Bummer...

Thanks, Christian.

--
Christian Roth
Email: roth (at) visualclick (dot) de
Mac.Java.Pasta.Sopranosax.Single.
Jul 21 '05 #4

P: n/a
mscir <ms***@yahoo.com> wrote:
Christian Roth wrote:
What I want is something like:

5. Item a
6. Item b
7. Item c


This is the only way I've seen it done:

<ol start="5">
<li>Item a</li>
<li>Item b</li>
<li>Item c</li>
</ol>


Thanks Mike, it really seems it cannot be done in XHTML Strict with CSS
on today's browsers.

Regards, Christian.

--
Christian Roth
Email: roth (at) visualclick (dot) de
Mac.Java.Pasta.Sopranosax.Single.
Jul 21 '05 #5

P: n/a
Christian Roth wrote:
mscir <ms***@yahoo.com> wrote:
Christian Roth wrote:
What I want is something like:
5. Item a
6. Item b
7. Item c
This is the only way I've seen it done:
<ol start="5">
<li>Item a</li>
<li>Item b</li>
<li>Item c</li>
</ol>


Thanks Mike, it really seems it cannot be done in XHTML Strict with CSS
on today's browsers.


I found this:

http://www.timrivera.com/tests/ol-start.html

I believe that right now the CSS approach works in Opera but not in
Netscape 7.2, IE 6, Firefox 1.0.1.

Mike
Jul 21 '05 #6

P: n/a
In article <MP************************@news.individual.net> ,
Lauri Raittila <la***@raittila.cjb.net> wrote:
in comp.infosystems.www.authoring.stylesheets, Christian Roth wrote:
Hello,

how do I offset the numbering of a list in XHTML Strict (+CSS) in
current browsers?
i.e. list numbering for the items within an <ol> starts at the value 5.

Is there a way to do this, probably using CSS?


Yes, counters in CSS2. Work on Opera, and Only Opera.

Best aproach with strict and CSS is usually use ul and add numbers on
content. Some discussion about this few days ago here:
http://groups.google.com/groups?&thr...91558@trndny08


Seems to me, if you really have a reason for starting the list items at 5,
then the list numbers *should* probably be considered as part of the page
content, rather than just a presentation issue. So using CSS for it would
be inappropriate.
Transitional is worth considering as well. There is no support for CSS
alternative, so it is legitime use of deprecated code.


--
= Eric Bustad, Norwegian bachelor programmer
Jul 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.