From 7dfe0cd826bceec4a0849b88ad810eb089eb38ed Mon Sep 17 00:00:00 2001 From: Chalarangelo Date: Mon, 21 Jun 2021 10:04:48 +0300 Subject: [PATCH] Add reversed list article --- blog_posts/reversed-list.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 blog_posts/reversed-list.md diff --git a/blog_posts/reversed-list.md b/blog_posts/reversed-list.md new file mode 100644 index 000000000..0924cbed9 --- /dev/null +++ b/blog_posts/reversed-list.md @@ -0,0 +1,26 @@ +--- +title: "Tip: Create a descending list of numbered items" +type: tip +tags: webdev,html +authors: chalarangelo +cover: blog_images/ancient-greek-building.jpg +excerpt: Did you know there's an easy way to create a descending list of numbered items with pure HTML? Learn how with this handy tip. +firstSeen: 2021-06-22T05:00:00-04:00 +--- + +Did you know there's an easy way to create a descending list of numbered items with pure HTML? The only thing you'll need is the `reversed` attribute. This boolean attribute is specific to `ol` elements and specifies that the list's elements are in reverse order (i.e. numbered from high to low). + +```html +
    +
  1. My third favorite
  2. +
  3. My second favorite
  4. +
  5. My absolute favorite
  6. +
+ +``` + +Additionally, you can combine `reversed` with the `start` attribute which is an integer specifying the initial value of the list counter. For example, if you wanted to display the numbers 6 through 4 in a reversed 3-item list, you would simply add `start="6"`.