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?
| SitePoint Sponsor |
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?


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.
Brilliant ideas, elegant execution.
Graphic Design, Art Direction, Copywriting and Web Design.
The doctype shouldn't make any difference here.
I think the reversed attribute isn't widely supported yet.
Simon Pieters


Where this doesn't work:
yo could use this instead (though it requires manual labor):Code:<ol reversed> <li>List Item</li> <li>List Item</li> <li>List Item</li> <li>List Item</li> <li>List Item</li> </ol>
It only validates with an HTML5 doctype, though: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>
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>


Ok thanks for the info.
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