Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Columns in Bootstrap

This is what I have at the moment on a on small devices.

enter image description here

This is the code for the image above.

<div class="row">
    <div class="col-sm-6">
        <div class="alert alert-info">Chart 1</div>
    </div>
    <div class="col-sm-6">
        <div class="alert alert-info">Chart 2</div>
    </div>
    <div class="col-sm-12">
        <div class="alert alert-danger">Legend</div>
    </div>
</div>

When this is shown on an extra small device the order is like this:

Chart 1
Chart 2
Legend

This is expected but not what I'm after. I want it to be like this:

Chart 1
Legend
Chart 2

Is this possible using Bootstrap?

like image 286
Høgsdal Avatar asked Jul 15 '26 20:07

Høgsdal


1 Answers

Here is your fixed code

<div class="row">
    <div class="col-sm-6">
        <div class="alert alert-info">Chart 1</div>
    </div>
     <div class="visible-sm visible-xs hidden-md hidden-lg">
         <div class="col-sm-12">
        <div class="alert alert-danger">Legend</div>
        </div>
    </div>
    <div class="col-sm-6">
        <div class="alert alert-info">Chart 2</div>
    </div>
    <div class="hidden-sm hidden-xs visible-md visible-lg">
    <div class="col-sm-12">
        <div class="alert alert-danger">Legend</div>
    </div>
    </div>
</div>

Cheers !

like image 180
J. Shabu Avatar answered Jul 18 '26 02:07

J. Shabu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!