ScAlAn

Howto change divs order

Task: Change divs order for mobile design

<div class="A">
  <div class="B"></div>
  <div class="C"></div>
</div>

Implementation:

<style>
  @media (max-width: 990px){
    .A { display: flex; flex-direction: column; }
    .B { order: 2; }
    .C { order: 1; }
  }
</style>
<div class="A">
  <div class="B"></div>
  <div class="C"></div>
</div>

Style definition you can add in the css file.

Done.

Leave a Reply

Your email address will not be published. Required fields are marked *

8  +  1  =