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

263
Views
How to change order of elements when device is mobile

I have sth like this

<div className="Image"><div><div className="Text"><div>
<div className="Text"><div><div className="Image"><div>
<div className="Image"><div><div className="Text"><div>

How to swap content between my divs when device is mobile??

Is any trick for it? Or should i write a code again for mobile? I use bootstrap and flex box.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Using Flexbox, you can use order.

.container{
  display:flex;
}
.order-1{
  order:1;
}
.order-2{
  order:2;
}
.order-3{
  order:3;
}
@media(min-width:992px){
  .order-lg-1{
    order:1;
  }
  .order-lg-2{
    order:2;
  }
  .order-lg-3{
    order:3;
  }
}
<div class="container">
  <div class="order-3 order-lg-2">A</div>
  <div class="order-2 order-lg-1">B</div>
  <div class="order-1 order-lg-3">C</div>   
</div>

about 4 years ago · Juan Pablo Isaza Report

0

div is originally display: block. You may have to put an outside div to envelop the three divs you have and apply display: flex.

div{
  display: flex;
  flex-wrap: wrap;
}
<div class="container">
  <div className="Image">image<div>           
  <div className="Text">text<div>            
  <div className="Image">image<div>            
</div>

When you reduce the screen size, the elements will be displayed in columns.

about 4 years ago · Juan Pablo Isaza 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!