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

how do I emulate the start attribute of ol tag deprecated in XHTML

P: n/a
how do I emulate the start attribute of ol tag deprecated in
XHTML (strict)?

Is it easily possible or only possible with great difficulty?

Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Zenobia wrote:
how do I emulate the start attribute of ol tag deprecated in
XHTML (strict)?


In theory, you use CSS counters.

In practise you use XHTML 1.0 Transitional, or not split lists into multiple
parts.

There has been some debate about this as regards XHTML 2 on the www-html
mailing list lately. One suggestion was an attribute that would link lists
together.

e.g.

<ol id="myList">
<li>Foo</li>
<li>Foo</li>
</ol>

<foo>

<ol continutes="myList">
<li>Foo</li>
<li>Foo</li>
</ol>

.... although I might be misremembering.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Jul 20 '05 #2

P: n/a
On Sat, 17 Apr 2004 18:50:27 +0100, David Dorward
<do*****@yahoo.com> wrote:
Zenobia wrote:
how do I emulate the start attribute of ol tag deprecated in
XHTML (strict)?


In theory, you use CSS counters.

In practise you use XHTML 1.0 Transitional, or not split lists into multiple
parts.

There has been some debate about this as regards XHTML 2 on the www-html
mailing list lately. One suggestion was an attribute that would link lists
together.

e.g.

<ol id="myList">
<li>Foo</li>
<li>Foo</li>
</ol>

<foo>

<ol continutes="myList">
<li>Foo</li>
<li>Foo</li>
</ol>

... although I might be misremembering.


I will use transitional XHTML because counters haven't been
implemented in IE6.

As a matter of curiosity, does the counter apply to the OL or
the LI tag? I guess it must apply the OL otherwise the
counter-reset attribute won't make sense.

Eg. In theory, is this what I could do with a browser that
supports counters?

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<style type="text/css">
ol:before {counter-reset: letr 1; content: counter(letr,
lower-roman) ". "}
ol.refs:before {counter-reset: letr 3; content:
counter(letr, lower-roman) ". "}
</style>
</head>
<body>
<h3>Notes:</h3>
<ol>
<li>One</li>
<li>Two</li>
</ol>
<h3>References:</h3>
<ol class="refs">
<li>Three</li>
<li>Four</li>
</ol>
</body>
</html>

Jul 20 '05 #3

P: n/a
Zenobia wrote:
I will use transitional XHTML because counters haven't been
implemented in IE6.
Or anywhere except Opera
As a matter of curiosity, does the counter apply to the OL or
the LI tag?
To whatever you want, but given you are numbering the <li>s, you would use
the counter on the <li>s.
I guess it must apply the OL otherwise the
counter-reset attribute won't make sense.
If you wanted to start the counter from 1 each time, you would apply the
reset to the <ol>.
Eg. In theory, is this what I could do with a browser that
supports counters?

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<style type="text/css">
ol:before {counter-reset: letr 1; content: counter(letr,
lower-roman) ". "}
ol.refs:before {counter-reset: letr 3; content:
counter(letr, lower-roman) ". "}
</style>


I've never used counters (as they aren't much practical use on the web), but
no. You let the counter continue counting for the second list, rather then
explicitly setting it to the value it would have counted to already.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.