OK. Is there any other way to do this then.....
Main Topics
Browse All TopicsHello,
how do I emulate the start attribute of <ol> in XHTML? I have an ordered list with some list items, but I need to close the ordered list, put in a header and some other content, then have another ordered list numbered where the first left off. I've read something about CSS counters, but I've never used them before and I don't know how widely supported they are.
<ol id="section1">
<li>First Item</li>
<li>Second Item</li>
<li>Third Item</li>
<li>Fourth Item</li>
</ol>
<h2>Header</h2>
<ol id="section2>
<li>Fifth Item</li>
<li>Sixth Item</li>
</ol>
Many Thanks, Adam.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
XHTML1.1 does not work in IE6 anyway since it cannot be served as text/html.
XHTML1.0 can be served as text/html but that's considered harmful.
Use an HTML doctype when you serve your pages as text/html, that's consistant.
Your issue is not so much HTML versus XHTML. It's about Strict versus Transitional.
The "start" attribute is deprecated but it will validate as Transitional (both HTML and XHTML).
Transitional is not less standard than Strict, it's just a different standard.
Strict is preferred but sometimes Transitional is needed for some browsers.
The most important thing is for your document to validate the doctype you are using.
CSS counters is a valid Strict alternative... theoretically.
It works fine in Opera and Konqueror. I suppose it also works fine in Safari.
IE6 does not even support the ":before" pseudo-element.
In my Firefox, it does not work on lists. For some strange reason the counter goes back to 1 in the second list. However, it works fine on <P> elements.
Here is the code i used:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html
<html>
<head>
<title>test</title>
<style type="text/css">
body {
background: #ddd;
color: #000;
}
li:before {
content: counter(itemcounter) ". ";
}
li {
counter-increment: itemcounter;
list-style: none;
}
p:before {
content: counter(pcounter) ". ";
}
p {
counter-increment: pcounter;
}
</style>
</head>
<body>
<ol id="section1">
<li>First Item</li>
<li>Second Item</li>
<li>Third Item</li>
<li>Fourth Item</li>
</ol>
<h2>Header</h2>
<ol id="section2" start="5">
<li>Fifth Item</li>
<li>Sixth Item</li>
</ol>
<p>First Item</p>
<p>Second Item</p>
<p>Third Item</p>
<p>Fourth Item</p>
<h2>Header</h2>
<p>Fifth Item</p>
<p>Sixth Item</p>
</body>
</html>
Hmmm
In firefox 2.0.0.1 I get on SCREEN
1. First Item
2. Second Item
3. Third Item
4. Fourth Item
Header
1. Fifth Item
2. Sixth Item
3. First Item
4. Second Item
5. Third Item
6. Fourth Item
Header
7. Fifth Item
8. Sixth Item
but when I cut and paste I get
1. First Item
2. Second Item
3. Third Item
4. Fourth Item
Header
5. Fifth Item
6. Sixth Item
First Item
Second Item
Third Item
Fourth Item
Header
Fifth Item
Sixth Item
Business Accounts
Answer for Membership
by: GrandSchtroumpfPosted on 2007-01-12 at 05:08:17ID: 18300861
Counters are not supported in IE6.