1

I want to know is there possible in bootstrap change col right go to upper when small? Default column in upper when small is left column.

I want like this:

--1-- --2-- --3--

when small like this:

--3--

--2--

--1--

this is my original code in bootstrap:

    <div class="row">
        <div class="col-sm-4">
            1
        </div>
        <div class="col-sm-4">
            2
        </div>
        <div class="col-sm-4">
            3
        </div>
    </div>
Reinstar
  • 146
  • 1
  • 1
  • 21

3 Answers3

3

Try this https://jsfiddle.net/2Lzo9vfc/41/

HTML

    <div class="row">
    <div class="col-sm-4 col-sm-push-8">
        3
    </div>
    <div class="col-sm-4">
        2
    </div>
    <div class="col-sm-4 col-sm-pull-8">
        1
    </div>
</div>
Nenad Vracar
  • 118,580
  • 15
  • 151
  • 176
0

You could put the third div first use the push and pull in bootstrap to move them around at larger screen sizes.

Here's someone with a similar problem:

Reverse grid arrangment?

And here's the documentation for push and pulling in bootstrap: http://getbootstrap.com/css/#grid-column-ordering

Community
  • 1
  • 1
Blake
  • 641
  • 6
  • 12
0

Something like the following should work.

<div class="row">
    <div class="col-md-4 col-sm-12">
        1
    </div>
    <div class="col-md-4 col-sm-12">
        2
    </div>
    <div class="col-md-4 col-sm-12">
        3
    </div>
</div>

You can add multiple "column types" to a class. You can use the following column types:

  1. .col-xs-*, for screens smaller than 768px wide
  2. .col-sm-*, for screens above 768px wide
  3. .col-md-*, for screens above 992px wide
  4. .col-lg-*, for screens above 1200px wide

References:

Audite Marlow
  • 1,034
  • 1
  • 7
  • 25