Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

269
Views
How to put a wrapped row in reverse order

Im using flexbox to ordening some elements and i need reverse the elements order with CSS and it gets weird:

|4|3|2|1|
|8|7|6|5|

and I need it to be this way:

|8|7|6|5|
|4|3|2|1|

ul {
  list-style: none;
  width: 208px;
  padding: 5px;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row-reverse
}

li {
  min-width: 50px;
  height: 50px;
  text-align: center;
  border: 1px solid red;
  color: #FFF;
  background-color: #000;
}
<ul>
  <li>1</li>
  <li>2</li>
  <li>3</li>
  <li>4</li>
  <li>5</li>
  <li>6</li>
  <li>7</li>
  <li>8</li>
</ul>

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Just make flex-wrap:wrap-reverse

ul{
  list-style: none;
  width: 208px;
  padding: 5px;
  display: flex;
  flex-wrap: wrap-reverse;
  flex-direction: row-reverse
}

li {
  min-width: 50px;
  height: 50px;
  text-align: center;
  border: 1px solid red;
  color: #FFF;
  background-color: #000;
}
<ul>
  <li>1</li>
  <li>2</li>
  <li>3</li>
  <li>4</li>
  <li>5</li>
  <li>6</li>
  <li>7</li>
  <li>8</li>
</ul>

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!