Connecting Tech Pros Worldwide Help | Site Map

Using CSS to set start number in an ordered list

  #1  
Old September 12th, 2008, 02:45 PM
some old html fumbler
Guest
 
Posts: n/a
I want to use CSS to get an ordered list to start with something other
than a 1 or equivalent.

I have a list of things that happen during the course of a year. Too
long a list is not helpful, so I only show maybe 3 months of items at
a time. The items have to be ordered according to the year, IOW I
can't list something in April as being #1.

In HTML after the first couple of months I just use this sort of code:
<ol start="14" type="1"and go on.

I see that the "start" attribute is deprecated in HTML 4.01. I don't
know what to plug into my css stylesheet to get an ordered list to
start at a number I designate. Any suggestions?
  #2  
Old September 12th, 2008, 02:55 PM
Andreas Prilop
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


On Fri, 12 Sep 2008, some old html fumbler wrote:
Quote:
In HTML after the first couple of months I just use this sort of code:
<ol start="14" type="1"and go on.
Any suggestions?
Use "HTML 4.01 Transitional" and keep the START attribute.

--
In memoriam Alan J. Flavell
http://www.alanflavell.org.uk/charset/
  #3  
Old September 12th, 2008, 04:55 PM
Helpful person
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


On Sep 12, 9:38*am, some old html fumbler <fumb...@nospam.invalid>
wrote:
Quote:
I want to use CSS to get an ordered list to start with something other
than a 1 or equivalent.
>
I have a list of things that happen during the course of a year. Too
long a list is not helpful, so I only show maybe 3 months of items at
a time. The items have to be ordered according to the year, IOW I
can't list something in April as being #1.
>
In HTML after the first couple of months I just use this sort of code:
<ol start="14" type="1"and go on.
>
I see that the "start" attribute is deprecated in HTML 4.01. I don't
know what to plug into my css stylesheet to get an ordered list to
start at a number I designate. Any suggestions?
You could also set a class to {display: none} in the CSS and include
the obsolete lines in this class. I think this would work. Anyone
know for sure?
  #4  
Old September 12th, 2008, 07:05 PM
Jonathan N. Little
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


Helpful person wrote:
Quote:
On Sep 12, 9:38 am, some old html fumbler <fumb...@nospam.invalid>
wrote:
Quote:
Quote:
>I see that the "start" attribute is deprecated in HTML 4.01. I don't
>know what to plug into my css stylesheet to get an ordered list to
>start at a number I designate. Any suggestions?
>
You could also set a class to {display: none} in the CSS and include
the obsolete lines in this class. I think this would work. Anyone
know for sure?
Huh?

Are you suggesting using 'display: none' to "hide" the deprecated
attributes 'start="14" type="1"'? Then no, absolutely not, it would just
prevent the OL from displaying altogether.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
  #5  
Old September 12th, 2008, 07:35 PM
some old html fumbler
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


On Fri, 12 Sep 2008 10:53:10 -0400, "Jonathan N. Little"
Quote:
>....
><ol start="14">
<li>If you want IE support and live with the deprecated attribute</li>
<li>Fee</li>
<li>Fie</li>
<li>Foe</li>
<li>Fum</li>
></ol>
>
></body>
></html>
Oh, IE won't even see it if I were to do accomplish it in CSS then?

*SIGH* I guess those pages just are never going to validate as HTML
4.01 strict then. I may as well just leave it transitional. Thanks.

And yet the "start" attribute is back for HTML 5.0 from what I see!
What a world.
  #6  
Old September 12th, 2008, 07:55 PM
Jonathan N. Little
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


some old html fumbler wrote:
Quote:
On Fri, 12 Sep 2008 10:53:10 -0400, "Jonathan N. Little"
Quote:
>....
><ol start="14">
> <li>If you want IE support and live with the deprecated attribute</li>
> <li>Fee</li>
> <li>Fie</li>
> <li>Foe</li>
> <li>Fum</li>
></ol>
>>
></body>
></html>
>
Oh, IE won't even see it if I were to do accomplish it in CSS then?
>
*SIGH* I guess those pages just are never going to validate as HTML
4.01 strict then. I may as well just leave it transitional. Thanks.
>
No, just keep DOCTYPE 4.01 Strict. USing a deprecated attribute will not
prevent your page from displaying...don't fret about it.
Quote:
And yet the "start" attribute is back for HTML 5.0 from what I see!
What a world.
HTML5.0 is still pie-in-the-sky and some of the suggestions I are far
from useful IMHO. But hey, cheer up, maybe MS can get IE to support the
10-year-old standard with version 8 or 9 or 10... ;-)


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
  #7  
Old September 12th, 2008, 08:15 PM
Helpful person
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


On Sep 12, 1:58*pm, "Jonathan N. Little" <lws4...@central.netwrote:
Quote:
Helpful person wrote:
Quote:
On Sep 12, 9:38 am, some old html fumbler <fumb...@nospam.invalid>
wrote:
Quote:
I see that the "start" attribute is deprecated in HTML 4.01. I don't
know what to plug into my css stylesheet to get an ordered list to
start at a number I designate. Any suggestions?
>
Quote:
You could also set a class to *{display: none} in the CSS and include
the obsolete lines in this class. *I think this would work. *Anyone
know for sure?
>
Huh?
>
Are you suggesting using 'display: none' to "hide" the deprecated
attributes 'start="14" type="1"'? Then no, absolutely not, it would just
prevent the OL from displaying altogether.
>
--
Take care,
>
Jonathan
-------------------
LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com
No. I'm suggesting adding the class only to the items not wanted.
The main question I have is: Will the browser still use the non
displayed items to incement the numbers? (Or will it just count the
displayed items?)
  #8  
Old September 12th, 2008, 08:25 PM
Chris F.A. Johnson
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


On 2008-09-12, Helpful person wrote:
Quote:
On Sep 12, 9:38*am, some old html fumbler <fumb...@nospam.invalid>
wrote:
Quote:
>I want to use CSS to get an ordered list to start with something other
>than a 1 or equivalent.
>>
>I have a list of things that happen during the course of a year. Too
>long a list is not helpful, so I only show maybe 3 months of items at
>a time. The items have to be ordered according to the year, IOW I
>can't list something in April as being #1.
>>
>In HTML after the first couple of months I just use this sort of code:
><ol start="14" type="1"and go on.
>>
>I see that the "start" attribute is deprecated in HTML 4.01. I don't
>know what to plug into my css stylesheet to get an ordered list to
>start at a number I designate. Any suggestions?
>
You could also set a class to {display: none} in the CSS and include
the obsolete lines in this class. I think this would work. Anyone
know for sure?
It wouldn't work if CSS was turned off or if the browser didn't
support CSS.

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
  #9  
Old September 12th, 2008, 10:35 PM
dorayme
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


In article <ukrkc45529k2ssh9btk241a9qag6ctjrjd@4ax.com>,
some old html fumbler <fumbler@nospam.invalidwrote:
Quote:
I want to use CSS to get an ordered list to start with something other
than a 1 or equivalent.
>
I have a list of things that happen during the course of a year. Too
long a list is not helpful, so I only show maybe 3 months of items at
a time. The items have to be ordered according to the year, IOW I
can't list something in April as being #1.
>
So do the most straightforward thing you can do in this situation and
use simple HTML and simple CSS that is cross browser and cross earthling
win-win. Use a two column table in which the column on the left holds
the numbers. In fact why would you be wanting to have numbers when you
can have the date itself and be utterly clear?

--
dorayme
  #10  
Old September 13th, 2008, 08:05 AM
some old html fumbler
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


On Sat, 13 Sep 2008 07:29:34 +1000, dorayme
<doraymeRidThis@optusnet.com.auwrote:
Quote:
>In article <ukrkc45529k2ssh9btk241a9qag6ctjrjd@4ax.com>,
some old html fumbler <fumbler@nospam.invalidwrote:
>
Quote:
>I want to use CSS to get an ordered list to start with something other
>than a 1 or equivalent.
>>
>I have a list of things that happen during the course of a year. Too
>long a list is not helpful, so I only show maybe 3 months of items at
>a time. The items have to be ordered according to the year, IOW I
>can't list something in April as being #1.
>>
>
>So do the most straightforward thing you can do in this situation and
>use simple HTML and simple CSS that is cross browser and cross earthling
>win-win. Use a two column table in which the column on the left holds
>the numbers. In fact why would you be wanting to have numbers when you
>can have the date itself and be utterly clear?
I have both the date and the number of the item. The number of the
item is relevant and needs to be part of the list. I'm just going to
leave it all as a transitional doctype.

I find it bizarre that they took this out for 4.01 and have it back in
again for 5.0.
  #11  
Old September 13th, 2008, 08:15 AM
Ed Mullen
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


Chris F.A. Johnson wrote:
Quote:
On 2008-09-12, Helpful person wrote:
Quote:
>On Sep 12, 9:38 am, some old html fumbler <fumb...@nospam.invalid>
>wrote:
Quote:
>>I want to use CSS to get an ordered list to start with something other
>>than a 1 or equivalent.
>>>
>>I have a list of things that happen during the course of a year. Too
>>long a list is not helpful, so I only show maybe 3 months of items at
>>a time. The items have to be ordered according to the year, IOW I
>>can't list something in April as being #1.
>>>
>>In HTML after the first couple of months I just use this sort of code:
>><ol start="14" type="1"and go on.
>>>
>>I see that the "start" attribute is deprecated in HTML 4.01. I don't
>>know what to plug into my css stylesheet to get an ordered list to
>>start at a number I designate. Any suggestions?
>You could also set a class to {display: none} in the CSS and include
>the obsolete lines in this class. I think this would work. Anyone
>know for sure?
>
It wouldn't work if CSS was turned off or if the browser didn't
support CSS.
>
True, but what percentage of users have CSS turned off or are using a
browser that doesn't support it? Statistically, I'm guessing it's
effectively zero.

--
Ed Mullen
http://edmullen.net
I always take life with a grain of salt, plus a slice of lemon and a
shot of tequila.
  #12  
Old September 13th, 2008, 11:05 AM
dorayme
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


In article <okomc41hc6j3t9odq7acef2pu07hqde9ho@4ax.com>,
some old html fumbler <fumbler@nospam.invalidwrote:
Quote:
On Sat, 13 Sep 2008 07:29:34 +1000, dorayme
<doraymeRidThis@optusnet.com.auwrote:
>
Quote:
In article <ukrkc45529k2ssh9btk241a9qag6ctjrjd@4ax.com>,
some old html fumbler <fumbler@nospam.invalidwrote:
Quote:
I want to use CSS to get an ordered list to start with something other
than a 1 or equivalent.
>
I have a list of things that happen during the course of a year. Too
long a list is not helpful, so I only show maybe 3 months of items at
a time. The items have to be ordered according to the year, IOW I
can't list something in April as being #1.
>
So do the most straightforward thing you can do in this situation and
use simple HTML and simple CSS that is cross browser and cross earthling
win-win. Use a two column table in which the column on the left holds
the numbers. In fact why would you be wanting to have numbers when you
can have the date itself and be utterly clear?
>
I have both the date and the number of the item. The number of the
item is relevant and needs to be part of the list. I'm just going to
leave it all as a transitional doctype.
I am puzzled as to how this is quite relevant to what I said? There is
even more reason to use a table then, you have a number and you have a
date and you have something that is supposed to happen or has happened
on that date. This suggests a three col table to me.

Take with a large grain of salt any voice inside you that says if a list
has numbers, and if it is ordered, then you must use an OL. It is not
true at all and you don't must do anything of the kind.

You have some information to convey. Convey it with the appropriate
tool, which is one that does not give you or anyone else grief. In this
case a table is an excellent tool and it will convey what you want and
it will be rock solid cross browser.

--
dorayme
  #13  
Old September 13th, 2008, 11:35 AM
Jukka K. Korpela
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


Ed Mullen wrote:
Quote:
Quote:
> It wouldn't work if CSS was turned off or if the browser didn't
> support CSS.
>
True, but what percentage of users have CSS turned off or are using a
browser that doesn't support it? Statistically, I'm guessing it's
effectively zero.
Factually, you are just making pointless guesses. Never depend on a guess
when you don't need to.

Quite a few pages are either unusable or awful when viewed "as the author
intended", with some crappy CSS code, and turn rather useful when CSS is
switched off. In fact, if you are looking for useful content, switching CSS
is often a good idea.

Besides, _anything_ in CSS code may be overridden by user style sheets,
ignored due to browser bugs, or just null and void since it does not apply
(e.g., color settings on Braille presentation).

--
Yucca, http://www.cs.tut.fi/~jkorpela/

  #14  
Old September 13th, 2008, 01:35 PM
Jonathan N. Little
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


Ed Mullen wrote:
Quote:
Chris F.A. Johnson wrote:
Quote:
>On 2008-09-12, Helpful person wrote:
Quote:
Quote:
Quote:
>>You could also set a class to {display: none} in the CSS and include
>>the obsolete lines in this class. I think this would work. Anyone
>>know for sure?
>>
> It wouldn't work if CSS was turned off or if the browser didn't
> support CSS.
>>
>
True, but what percentage of users have CSS turned off or are using a
browser that doesn't support it? Statistically, I'm guessing it's
effectively zero.
>
Doesn't matter since the suggestion of hiding the "extra" LIs does not
work. The first displayed LI will be *1*...

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
  #15  
Old September 13th, 2008, 01:55 PM
Jonathan N. Little
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


some old html fumbler wrote:
Quote:
I have both the date and the number of the item. The number of the
item is relevant and needs to be part of the list. I'm just going to
leave it all as a transitional doctype.
As I said earlier, if this is a new page then use strict. Don't change
your doctype just because you have one error, and a very minor on at
that. It is not that you page will refuse to display or blow up! All
your doing is using a deprecated attribute which means is *may* not be
supported in future browsers, but in practice it hasn't happened, except
for NN's layer, but look embed is still supported.
Quote:
>
I find it bizarre that they took this out for 4.01 and have it back in
again for 5.0.
Again, 5.0 is still a pipe dream, I hazard a guess that the only reason
its return is being considered is due to MSIE's piss-poor CSS support.
Maybe MS will finally step up to the plate, or better yet die a
beautiful death...buried by other better options of Firefox, Opera,
Safari, Chrome and other to follow!


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
  #16  
Old September 14th, 2008, 02:05 PM
Stan Brown
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


Sat, 13 Sep 2008 06:55:25 GMT from some old html fumbler
<fumbler@nospam.invalid>:
Quote:
I have both the date and the number of the item. The number of the
item is relevant and needs to be part of the list.
Then it should not be dependent on CSS, which is for presentational
aspects only.

If the numbers of the items matter, I believe you should include them
in your source file.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
  #17  
Old September 14th, 2008, 07:15 PM
Roy A.
Guest
 
Posts: n/a

re: Using CSS to set start number in an ordered list


On 13 Sep, 14:48, "Jonathan N. Little" <lws4...@central.netwrote:
Quote:
some old html fumbler wrote:
>
Quote:
I have both the date and the number of the item. The number of the
item is relevant and needs to be part of the list. I'm just going to
leave it all as a transitional doctype.
>
As I said earlier, if this is a new page then use strict. Don't change
your doctype just because you have one error, and a very minor on at
that. It is not that you page will refuse to display or blow up!
That's true, doctype don't mean that much, but the difference between
'standards mode' and 'almost standards mode' is marginal. The main
difference is how layout with sliced images is aligned within table
cells.

There are some few other differences, e.g.:
http://www.tidraso.co.uk/misc/quirks-mode/

There might be a few others, but it won't make much difference if you
use HTML 4.01 Strict, instead of HTML 4.01 Transitional. IE 6
and IE 7 are using 'almost standards mode' anyway. And if you want it
to work in those browsers, I can't see why a strict doctype is
better than an transitional doctype. You're using the 'start'
attribute as an transition to the 'counter-reset' property, aren't
you?
Quote:
All
your doing is using a deprecated attribute which means is *may* not be
supported in future browsers, but in practice it hasn't happened, except
for NN's layer, but look embed is still supported.
If you're using an Transitional doctype the 'start' attribute is in
the specification, so that attribute will be supported as long as that
doctype
is supported. The NN's layer isn't in HTML 4.01.

By using the strict doctype, and ignoring the doctype declaration, you
could as well use '<!DOCTYPE html>. Even IE 6, supports that.

You could of course use HTML 4.01 Strict and both 'counter-reset' and
the deprecated attribute 'start'. That would work, even if the browser
don't recognize the 'start' attribute.
Quote:
Quote:
I find it bizarre that they took this out for 4.01 and have it back in
again for 5.0.
Not much more of a dream than your own dream. In fact, you're dreaming
the same thing, when you say that the 'start' attribute "*may* not be
supported in future browsers, but in practice it hasn't happened".
Quote:
Again, 5.0 is still a pipe dream, I hazard a guess that the only reason
its return is being considered is due to MSIE's piss-poor CSS support.
Maybe MS will finally step up to the plate, or better yet die a
beautiful death...buried by other better options of Firefox, Opera,
Safari, Chrome and other to follow!
I can't argue with that.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion to PHP5 The Big One answers 5 July 16th, 2008 09:33 AM