Open In App
Related Articles

Tailwind CSS Order

Improve Article
Save Article
Like Article

Order is one of the best feature of tailwind CSS by using this class we can order the flex and grid items according to our requirements. There are lots of order class. This class is used to render flex and grid items in a different order than they appear in the DOM.


  • order-1
  • order-2
  • order-3
  • order-4
  • order-5
  • order-6
  • order-7
  • order-8
  • order-9
  • order-10
  • order-11
  • order-12
  • order-first
  • order-last
  • order-none


<element order- number | string >

Parameter: This class accepts two types of parameters, but one at a time, can only follow the order number or the position you will mention.

  • number: Integer number to follow the order index.
  • string: In word order index position, only accept last and first.

Example: In this example, we set the order-last on the first flex item and set the order-first on the 5th flex item, now you can see the order list is different from the normal.


<!DOCTYPE html> 
    <title>Tailwind order Class</title
    <link href=
<body class="text-center"
    <h1 class="text-green-600 text-5xl font-bold">
    <b>Tailwind CSS order Class</b
    <div id="main" class="flex flex-row justify-evenly"
        <div class="bg-green-900 order-last w-24 h-12">1</div
        <div class="bg-green-800 w-24 h-12">2</div
        <div class="bg-green-700 w-24 h-12">3</div
        <div class="bg-green-600 w-24 h-12">4</div
        <div class="bg-green-500 order-first w-24 h-12">5</div
        <div class="bg-green-400 w-24 h-12">6</div


Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 23 Mar, 2022
Like Article
Save Article
Similar Reads
Complete Tutorials