html - How to reverse order of cols in responsive Bootstrap 3? -


demo: http://jsfiddle.net/su0ae5v9/

html:

<div class="container">     <div class="row">         <div class="col-sm-6 text-center">             image         </div>         <div class="col-sm-6 text-center">             desctiption         </div>     </div>     <div class="row">         <div class="col-sm-6 text-center reverse">             desctiption         </div>         <div class="col-sm-6 text-center reverse">             image         </div>     </div>     <div class="row">         <div class="col-sm-6 text-center">             image         </div>         <div class="col-sm-6 text-center">             desctiption         </div>     </div>     <div class="row">         <div class="col-sm-6 text-center reverse">             desctiption         </div>         <div class="col-sm-6 text-center reverse">             image         </div>     </div> </div> 

css:

.container {     background: beige; } .reverse {     background: salmon; } 

i have alternate rows image on left , description right, reversed on next row. might have expand jsfiddle preview see it.

when responsive (narrow), want image on top , description @ bottom, order is

image

description

image

description

css ideal, have jquery solution needs work on wondow.resize , it's nasty.

using .pull , .push trick!

updated working demo: http://jsfiddle.net/knq9qrom/1/

html:

<div class="container">     <div class="row">         <div class="col-sm-6 text-center">             image         </div>         <div class="col-sm-6 text-center">             desctiption         </div>     </div>     <div class="row">         <div class="col-sm-6 text-center col-sm-push-6 reverse">             image         </div>         <div class="col-sm-6 text-center col-sm-pull-6 reverse">             desctiption         </div>     </div>     <div class="row">         <div class="col-sm-6 text-center">             image         </div>         <div class="col-sm-6 text-center">             desctiption         </div>     </div>     <div class="row">         <div class="col-sm-6 text-center col-sm-push-6 reverse">             image         </div>         <div class="col-sm-6 text-center col-sm-pull-6 reverse">             desctiption         </div>     </div> </div> 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -