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?

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.

The doctype shouldn’t make any difference here.

I think the reversed attribute isn’t widely supported yet.

Where this doesn’t work:

<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):

<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:

<!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>

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?

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. :slight_smile:

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.