0

I have code like this using Bootstrap 3 for desktop devices:

<div class="row">
<div class="col-md-5">
<img src="logo.png">
</div>
<div class="col-md-4">
Element 1
</div>
<div class="col-md-3">
Element 2
</div>
</div>

I want to change positions of the colums for mobile version only to change Element 1 and Element 2 HTML code how can I do with jQuery or ?

I want this change for mobile devices, I don't know how to change positions of the elements? I need this in results

  <div class="row">
    <div class="col-md-5">
    <img src="logo.png">
    </div>
    **<div class="col-md-3">
    Element 2
    </div>**
    <div class="col-md-4">
    Element 1
    </div>
    </div>
Cœur
  • 37,241
  • 25
  • 195
  • 267
user2169710
  • 399
  • 1
  • 3
  • 8

3 Answers3

1

You may find helpful the text from the Bootstrap documentation:

column ordering.

Also, there is more detailed usage examples and explanation in this thread on Stackoverflow.

Community
  • 1
  • 1
ivan.mylyanyk
  • 2,051
  • 4
  • 30
  • 37
0

You can achieve the same result using jQuery. The same problem was already answered here: Swtich 2 divs

Community
  • 1
  • 1
WhiteAngel
  • 2,594
  • 2
  • 21
  • 35
0

try this:

   <div class="row">
        <div class="col-xs-5">
            Element 0
        </div>
        <div class="col-xs-4 col-xs-push-3 col-sm-push-0">
            Element 1
        </div>
        <div class="col-xs-3 col-xs-pull-3 col-sm-pull-0">
            Element 2
        </div>
    </div>

this changes the position of the columns for eg mobile devices. As you can see im working with push and pull. To get the right positions of the elements you had to reset the pull/push for the specific widths.

Steven Web
  • 1,966
  • 13
  • 23