Ordered Lists... help!!

admin

Administrator
Staff member
Aaagh. I'm trying to make a website I'm working on conform to HTML 4.01 Strict. <br />
<br />
I've got an ordered list which starts at 3 (rather than 1), and I had used <li value="3"> to get this to work, but this doesn't seem to be allowed in HTML 4.01. <br />
<br />
How do I make the list start at 3 without using the "value" or "start" commands?? <br />
<br />
Thanks.<!--content-->Just a stupid question. Why do you want to start with 3?<!--content-->hmm I guess everyone loves lists that start at 3... LOL<br />
<br />
<html><br />
<head><br />
<title>Untitled</title><br />
<style type="text/css"><br />
<!--<br />
.hidden {<br />
visibility:hidden;<br />
font-size:1px;<br />
line-height:1px;<br />
}<br />
--><br />
</style><br />
<br />
</head><br />
<body><br />
<ol><br />
<li class="hidden">hello</li><br />
<li class="hidden">hello</li><br />
<li>Number 3...</li><br />
</ol><br />
</body><br />
</html><!--content-->The proper way is to use CSS2 and Counters (<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-CSS2/generate.html#counters">http://www.w3.org/TR/REC-CSS2/generate.html#counters</a><!-- m -->).<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"<br />
"http://www.w3.org/TR/html4/strict.dtd"><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br />
<meta name="Content-Script-Type" content="text/javascript"><br />
<title>Example</title><br />
<br />
<style type="text/css"><br />
<!-- <br />
ol {counter-reset:item 3}<br />
li {display:block}<br />
li:before {content:counter(item) ". "; counter-increment:item}<br />
--><br />
</style><br />
<br />
<ol><br />
<li>Fee</li><br />
<li>Fie</li><br />
<li>Foe</li><br />
<li>Fum</li><br />
</ol><br />
<br />
You will find, however, that bad browsers do not understand counters - even though the CSS2 Specification came out in 1998. And as MSIE is one of those bad browsers, this is a good place to give up and use the Transitional DTD.<!--content-->Thanks for your help.<br />
<br />
The reason I want the list to start at 3 is because it covers two pages. Items 1 and 2 are on the previous page. I'm not just some weirdo who must make all his lists begin at 3! lol.<br />
:D <br />
<br />
I tried the counter method, but of course I'm using MSIE, so it didn't work.<br />
<br />
I think I'll go with the hidden method because that seems to work. Will it work in all browsers?<br />
<br />
If not, then is it OK to use the Transitional DTD for this page, while the rest use the Strict DTD?<br />
<br />
Thanks again, you've been a big help.<!--content-->It's a far, far, better thing to use the Transitional DTD, and you don't have to use the same DTD throughout a site. From the Web COntent Accessibility Guidelines 1.0<br />
6.1 Organize documents so they may be read without style sheets. For example, when an HTML document is rendered without associated style sheets, it must still be possible to read the document. [Priority 1]<br />
<!-- m --><a class="postlink" href="http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-order-style-sheets">http://www.w3.org/TR/WCAG10/wai-pageaut ... yle-sheets</a><!-- m --><br />
<br />
3.6 Mark up lists and list items properly. [Priority 2]<br />
<!-- m --><a class="postlink" href="http://www.w3.org/TR/WCAG10/wai-pageauth.html#tech-list-structure">http://www.w3.org/TR/WCAG10/wai-pageaut ... -structure</a><!-- m --><!--content-->
 
Back
Top