473,387 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Offset list numbering in XHTML Strict?

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
6 7377
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Nobody | last post by:
Okay, you are all so smart in here. Answer me this: IE6 in standards mode doesn't seem to hide scrollbars on the body element (overflow:hide) Ain't this a quandary. I have it in my head that I...
33
by: Jim Cobban | last post by:
I cannot get Netscape 4.79 to properly display the ordered list in the following fragment. <P>Get a specific portion of the date. Depending upon the value of index: <ol start=0> <li>complete...
35
by: The Bicycling Guitarist | last post by:
My web site has not been spidered by Googlebot since April 2003. The site in question is at www.TheBicyclingGuitarist.net/ I received much help from this NG and the stylesheets NG when updating the...
16
by: Peter Maas | last post by:
The XHTML file below creates a 2x2 matrix of square images. There is always some space at the bottom borders of the cells (when rendered with Gecko and KHTML, not with IE) and I've found no way so...
82
by: Buford Early | last post by:
I read this in http://annevankesteren.nl/2004/12/xhtml-notes "A common misconception is that XHTML 1.1 is the latest version of the XHTML series. And although it was released a bit more than a...
24
by: Dan Jacobson | last post by:
I shall jump on the XHTML bandwagon. I run my perfectly good html4/strict pages thru $ tidy -asxhtml -utf8 #to get: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"...
20
by: Alan Silver | last post by:
Hello, I have read about the problems that IE has when using a doctype of HTML 4.01 Transitional. I was advised to use Strict wherever possible. My question is, does the same apply to XHTML...
11
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a...
1
by: DeveloperQuest | last post by:
How do I make Xhtml 1.0 strict or Xhtml 1.1 strict appear in the Visual Studio 2005 dropdown? How do I add a Xhtml 1.0 strict to the dropdown in visual studio 2005? I have used the default...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.