I’ve this twitter-bootstrap grid structure.
<div class="row">
<div class="col-lg-8">A</div><div class="col-lg-4">B</div>
</div>
<div class="row">
<div class="col-lg-4">C</div><div class="col-lg-8">D</div>
</div>
If I reduce the screen size, the output will be:
A
B
C
D
My question is, is it possible to let the output become
A
B
D
C
in smaller size and become
A B
C D
in desktop screen size?
3
Answers
I have used flexible box solution for the output. Reordered the divs
C
andD
based on the screen size < 768px. Check the browser compatibility table here: Can I use FlexboxI am not sure why you want in smaller displays have the output as
because as smaller display you have, as more narrow your width becomes, meaning for best performance, you should place elements rather in the column. Here is jsfiddle
col-lg-*
is for large screenscol-md-*
is for medium screenscol-sm-*
is for small screenscol-xs-*
is for extra small screensdefine others to achieve what you are expecting and wrap all
col-*
in onerow
class.