SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 26
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2007
    Location
    East of Ottawa, ON
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question start attribute in <ol> tag

    is there an equivalent for <ol start="4"> in strict html?

  2. #2
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try using the value attribute in the li element instead

    http://www.w3.org/TR/html401/struct/lists.html

    Details about number order. In ordered lists, it is not possible to continue list numbering automatically from a previous list or to hide numbering of some list items. However, authors can reset the number of a list item by setting its value attribute. Numbering continues from the new value for subsequent list items. For example:
    Code:
    <ol>
    <li value="30"> makes this list item number 30.
    <li value="40"> makes this list item number 40.
    <li> makes this list item number 41.
    </ol>

  3. #3
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    value="" isn't allowed in HTML4 Strict either.

    <ol start> is currently allowed in HTML5 (draft)... FWIW.
    Simon Pieters

  4. #4
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well ... I'll be ... you're right I just tested it.

    value is deprecated

    So ... why even tell people to use it then?!

  5. #5
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That start="" and value="" are not allowed in HTML4 Strict is considered a bug in the spec which is why they're allowed in HTML5.
    Simon Pieters

  6. #6
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah ... thank for the clarification Simon!

    And sorry for getting your hopes up geargolum

    So ... looks like there's no replacement.

  7. #7
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Automatic numbering is a CSS2 feature, but it's not implemented very well in today's browsers. I think that was the original reasoning behind removing the start/value attributes from lists in Strict HTML, but it's useless in real life unless you only code for Opera.

  8. #8
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by karinne View Post
    And sorry for getting your hopes up geargolum

    So ... looks like there's no replacement.
    Why would it need replacing? Just use start=""...
    Simon Pieters

  9. #9
    \m/\m/ karinne's Avatar
    Join Date
    Dec 2002
    Location
    Aylmer, QC, Canada
    Posts
    409
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But start is also a deprecated attribute ... He was trying to find a valid replacement for it ... Like Vinnie said, there's the counter- property in CSS but not many browser supports it.

  10. #10
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's presentational and belongs in CSS, IMHO. Unfortunately only Opera supports generated content for list numbers properly,
    Birnam wood is come to Dunsinane

  11. #11
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    It's presentational and belongs in CSS, IMHO.
    Respectfully disagree.

    Sometimes you want to break up an ordered sequence, where the second list continues on the first one. It could be because you want to comment a few things or because you want to split it up on several pages (e.g. search results).

    start="" might not be the most elegant way to do this but that's what we have.
    Simon Pieters

  12. #12
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    what i do, if i really need it, i just use start=

    and i don't bother to change my doctype (it's always HTML Strict)

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  13. #13
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    It's presentational and belongs in CSS, IMHO. Unfortunately only Opera supports generated content for list numbers properly,
    I can see arguments for both. If it's a simple ordered list one might not care how it's numbered/lettered. But in something like a research paper outline where the number/letter corresponds to a numbered/lettered section I would consider it to be more content than presentation, because it may not make sense out of context otherwise.

  14. #14
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree with Vinnie.

    Actually Mozilla 1.8+ and Konqueror 3 (tested in 3.4+) support the CSS2 way to do this too. iCab 3 may support it as well. If anyone wants to see my test page, just ask and I'll be happy to make it publicly available.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  15. #15
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zcorpan View Post
    Respectfully disagree.

    Sometimes you want to break up an ordered sequence, where the second list continues on the first one.
    I've seen this argument before and I understand the reasoning behind it, but I don't agree with it. You are mixing semantics with presentation.

    The semantics of an OL is an ordered list. That means a sequence of items in a given order. If you change the order of the items, you change the meaning of the list as a whole. That's all it means. The actual numbering is a presentational issue; the only semantics inferred is that the first list item must precede the second, and so on.

    You don't have to break up an ordered sequence to introduce comments. The comments can be a part of the list item to which they apply, and CSS can handle the styling.

    Splitting an ordered list over multiple pages might mean that you shouldn't use OL in the first place. Let's say you have an ordered list with 10 items and you want to split it over two pages. Pages on the web exist in isolation, so the two lists are independent from one another. The first list with five items is one separate list, the second list with five items is another separate list. There is nothing that connects them, semantically. This means that, by splitting the list into two you are changing the semantics of the whole list. In this case you probably shouldn't use two OL elements. There is, presumably, a lot of content in each item since you need to split the list over two pages. I think using headings and paragraphs would be more appropriate in this case. If the numbering is necessary (and germane to the content) it should be part of the content, e.g., <h2>3. Widget Installation</h2>

    If the list's semantics allows you to split it in two, you have two separate, independent lists. Both are ordered, so you should use OL. In this case the numbering is purely presentational, so it should be left to CSS.

    This is just my take on it. YMMV.
    Birnam wood is come to Dunsinane

  16. #16
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tommy, what about blog comments split over multiple pages and SERPs? Are you saying that <ol>s should not be used for them?
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  17. #17
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Kravvitz View Post
    Tommy, what about blog comments split over multiple pages and SERPs? Are you saying that <ol>s should not be used for them?
    i'm not tommy but my answer would be: don't do that then
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  18. #18
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As I said before, an OL indicates a single list in which the order of the list items decide the meaning of the list as a whole. It is semantically isolated from other OL elements, even on the same page.

    Blog comments have an internal order based on when they were posted, so an OL seems like the logical choice. But if you split the list into multiple lists on separate pages, you are to some degree violating the list's semantics. On the other hand, each sub-list is still ordered, so you might mark them up with OL and use CSS to control the numbering.

    If you have 10 comments per page, then the second page would include comments 11 through 20. Marking them up as an OL would be acceptable, because they are an ordered subset of the total set of comments. But the ordinal numbers do not belong in the markup. They are a presentational issue, since you made the presentational choice of splitting the list over multiple pages. Semantically, the comments are one single list; not many small ones. Thus, if you want the page 2 comments to start at #11, you should use CSS to achieve that. Semantically, the ordinal number of comment #11 is 1, because it's the first item in that list on that page. IMHO.

    It's the same thing for SERPs, except that search engine companies don't seem to care very much about standards or semantics.
    Birnam wood is come to Dunsinane

  19. #19
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by W3C
    Until either CSS2 is widely supported by user agents or user agents allow users to control rendering of lists through other means, authors should consider providing contextual clues in nested lists.
    http://www.w3.org/TR/WCAG10-CSS-TECHS/#lists
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  20. #20
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    They should introduce a continuefrom attribute or something similar. That way, it is semantic, AND it allows a list to continue from a previous one.

    eg:
    Code:
    <ol id="firstpartoflist">
     <li>...</li>
     <li>...</li>
     <li>...</li>
     <li>...</li>
     ...
    </ol>
    
    [some more content here]
    
    <ol id="secondpartoflist" continuefrom="firstpartoflist">
      <li>...</li>
      <li>...</li>
      <li>...</li>
      <li>...</li>
     ...
    </ol>
    Would that not be an ideal solution? Or am I missing something?

  21. #21
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How is that semantic? If you need something in the middle, which is not part of the list, then it must be two lists.
    If it is a single list, you shouldn't split it in two.
    Birnam wood is come to Dunsinane

  22. #22
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Well if you start placing restrictions and telling people how they should write their documents, then no it isn't. But if there is someone who wants to split a list up, it is semantic in the sense that it will link the second list to the first. It's better than using a start attribute, in any case - with this you would be able to insert new elements in the first part without changing anything else.

  23. #23
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    As an example, people might want to split it up to put advertising in the middle of it. Lots of online magazines and newspapers do this sort of thing with articles. There's no reason why it couldn't be done in the middle of a long list.

  24. #24
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Or, step by step instructions that are split into larger sections, eg days. You have a day 1 section with steps 1-12 maybe, then a day 2 section, new header and introduction paragraph, with steps 13-27 etc...

    There are lots of reasons why you might want to.

  25. #25
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    That is why CSS2 (and HTML5) will allow lists to start at any number.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •