SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Jun 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reversed Ordered List not working

    I'm trying to reverse the order of a list. I have tried:

    <ol reversed="reversed"> and <ol reversed>

    but i see no changes. any tips please?

  2. #2
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,801
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    Welcome to Sitepoint.

    My first guess would be that you don't have an HTML5 doctype for your page, or that you are viewing the page in a browser that has no support for HHTML5. It really difficult to answer w/o seeing your full code tho.

  3. #3
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The doctype shouldn't make any difference here.

    I think the reversed attribute isn't widely supported yet.
    Simon Pieters

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Where this doesn't work:

    Code:
    <ol reversed>
      <li>List Item</li>
      <li>List Item</li>
      <li>List Item</li>
      <li>List Item</li>
      <li>List Item</li>
    </ol>
    yo could use this instead (though it requires manual labor):


    Code:
    <ol>
      <li value="5">List Item</li>
      <li value="4">List Item</li>
      <li value="3">List Item</li>
      <li value="2">List Item</li>
      <li value="1">List Item</li>
    </ol>
    It only validates with an HTML5 doctype, though:

    Code:
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title></title>	
    </head>
    <body>
    
    <ol>
      <li value="5">List Item</li>
      <li value="4">List Item</li>
      <li value="3">List Item</li>
      <li value="2">List Item</li>
      <li value="1">List Item</li>
    </ol>
    
    </body>
    </html>

  5. #5
    SitePoint Member
    Join Date
    Jun 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    yo could use this instead (though it requires manual labor):
    That works and I've used it in the past. It's just doesn't seem efficient though.

    Any other ideas why <ol reversed> doesn't work?

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by webpagedesign View Post
    Any other ideas why <ol reversed> doesn't work?
    It works in some browsers (like Chrome). It's just very new, and not official HTML yet, so it's not reliable at this stage. HTML5 is not finished yet.

  7. #7
    SitePoint Member
    Join Date
    Jun 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok thanks for the info.

    It would really be convenient if this tag worked as it should.

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by webpagedesign View Post
    It would really be convenient if this tag worked as it should.
    "Should" is the wrong way to think of this, though. It's a part of the proposed HTML5, which is not finished yet—meaning it's not official HTML at this stage. So there's no onus on any browser to support it yet. The fact that some are experimenting with it is cool, but we will have to be patient with HTML5, as it's a long way off yet.


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
  •