Bootstrap change div order with pull-right, pull-left on 3 columns

前端 未结 2 1840
無奈伤痛
無奈伤痛 2020-11-30 20:33

I’ve been working on this the whole day but don’t come up with a solution. I have 3 columns in one row in a container.

1: right content – pull-right

2: navig

相关标签:
2条回答
  • 2020-11-30 21:03

    Bootstrap 3

    Using Bootstrap 3's grid system:

    <div class="container">
      <div class="row">
        <div class="col-xs-4">Menu</div>
        <div class="col-xs-8">
          <div class="row">
            <div class="col-md-4 col-md-push-8">Right Content</div>
            <div class="col-md-8 col-md-pull-4">Content</div>
          </div>
        </div>
      </div>
    </div>
    

    Working example: http://bootply.com/93614

    Explanation

    First, we set two columns that will stay in place no matter the screen resolution (col-xs-*).

    Next, we divide the larger, right hand column in to two columns that will collapse on top of each other on tablet sized devices and lower (col-md-*).

    Finally, we shift the display order using the matching class (col-md-[push|pull]-*). You push the first column over by the amount of the second, and pull the second by the amount of the first.

    0 讨论(0)
  • 2020-11-30 21:04

    Try this...

    <div class="row">
        <div class="col-xs-3">
            Menu
        </div>
        <div class="col-xs-9">
            <div class="row">
              <div class="col-sm-4 col-sm-push-8">
              Right content
              </div>
              <div class="col-sm-8 col-sm-pull-4">
              Content
              </div>
           </div>
        </div>
    </div>
    

    Bootply

    0 讨论(0)
提交回复
热议问题