0

I have two divs,

<div class="col-md-6"> First Content </div>
<div class="col-md-6"> Second Content </div>

When it is full screen, I want to show the "First content" first and then the "Second Content", but when the screen size is small, I want to show the "Second Content" first and below it the "First Content".

Is there a way? I want to implement this with raw css or bootstrap.

Yeasir Arafat
  • 1,425
  • 1
  • 13
  • 28
  • Does this answer your question? [https://stackoverflow.com/questions/37814508/order-columns-through-bootstrap4](https://stackoverflow.com/questions/37814508/order-columns-through-bootstrap4) – Rob Moll Jun 26 '20 at 12:23

1 Answers1

1

I think the answer you are looking for is using flex-wrap: wrap-reverse. Something like this:

#wrapper{
display: flex;
flex-wrap: wrap;
text-align:center;
}

.first, .second{
width: 400px;
margin: auto;
height:400px;
}

.first{
background: red;
}

.second{
background:yellow;
}

@media only screen and (max-width:500px){
  #wrapper{
  flex-wrap:wrap-reverse;
}
}
<div id="wrapper">
<div class="first">First</div>
<div class="second">Second</div>
</div>