An attribute or CSS property would be great.
Announcement
Collapse
No announcement yet.
Is there a way to get <ol> to start numbering with a number other than 1?
Collapse
X
-
Is there a way to get <ol> to start numbering with a number other than 1?
David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!Tags: None
-
Doesn't seem to exist under xhtml1.1, but it works in Moz. Is it valid?David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!
Comment
-
For valid code use counter-reset. See http://www.w3.org/TR/CSS2/generate.html#countersCheck out the Forum Search. It's the short path to getting great results from this forum.
Comment
-
It's valid transitional, but not strict. I'm not sure I agree with the HTML WG about making counters CSS based, though - I consider them semantic and not just presentational, because the may have real, useful meaning.
From the [XHTML1.0 Transitional DTD]:
Code:<!ELEMENT ol (li)+> <!ATTLIST ol %attrs; type %OLStyle; #IMPLIED compact (compact) #IMPLIED start %Number; #IMPLIED >
liorean <[[email protected]]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards
Comment
-
Hi there me'
.....or use a little js...
<script type="text/javascript">
<!--
function Order()
{
document.getElementById('ol').start='10';
}
onload=Order;
//-->
</script>
<ol id="ol">
<li >one</li>
<li >two</li>
<li >three</li>
</ol>
cthead
~ the original bald headed old fart ~
Comment
-
thats ok but isnt very nice to have stuck into the middle of a page. The page then seems not to make sense if the user doesnt have javascript enabled.PHP Weekly - A PHP Developers Resource
PHP 5.1.4 and Ruby on Rails web hosting
Moderator of PHP and Work offers and Requests
Install Apache/PHP/MySQL (by marek_mar) | TinyPlugin Architecture
Comment
-
Originally posted by missing-score
thats ok but isnt very nice to have stuck into the middle of a page. The page then seems not to make sense if the user doesnt have javascript enabled.David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!
Comment
-
oh i see, fair doos.PHP Weekly - A PHP Developers Resource
PHP 5.1.4 and Ruby on Rails web hosting
Moderator of PHP and Work offers and Requests
Install Apache/PHP/MySQL (by marek_mar) | TinyPlugin Architecture
Comment
-
Hi there missing-score,
thats ok but isnt very nice to have stuck into the middle of a page. The page then seems not to make sense if the user doesnt have javascript enabled.
cthead
~ the original bald headed old fart ~
Comment
-
whatever lol, i wasnt really meaning where it would be exactly, i doubt the script would be in the exact middle anyways even if it was in the body tag, but what i meant is for a site that the world could visit, it would be better if there was a non js alternative.PHP Weekly - A PHP Developers Resource
PHP 5.1.4 and Ruby on Rails web hosting
Moderator of PHP and Work offers and Requests
Install Apache/PHP/MySQL (by marek_mar) | TinyPlugin Architecture
Comment
-
I'm with liorean on this one - if the numbering system is vital to the meaning of the list, then you should use "list-style-type:none" on a <ul> and then implement the numbering manually."Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark
Comment
-
Originally posted by brothercake
I'm with liorean on this one - if the numbering system is vital to the meaning of the list, then you should use "list-style-type:none" on a <ul> and then implement the numbering manually.
It just feels so wrong to number a list using JS. But if it's only for you to view (David), then obviously it's far less crutial.
I take no responsibility for the above nonsense.
Left Justified
Comment
-
Well that's semantically incorrect. It's not an unordered list, it's an ordered one. Although that solution applies to <ol> as well.David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!
Comment
Comment