I want to create a reverse effect with Bootstrap (1st row: Text on the left, image on the right 2nd row: Image on the left, text on the right 3rd row: Text on the left, image
Assuming you are using Bootstrap 4 (which is the current version of Bootstrap), you're using flexbox under the hood. That means you can simply lay out the content in the way you would like it to appear for mobile sites in the DOM (writing out the text before the image in the HTML), and then make use of flex-direction: row-reverse for the rows that you wish to have the image appear on the left for desktop views. To get really fancy, you can apply this to .row:nth-of-type(even) (or odd
) to invert every second row.
This can be seen in the following:
.row:nth-of-type(even) {
flex-direction: row-reverse;
}
Réfection de toiture
Que ce soit un toit de bardeau, de tôle ou à faible pente, Toitures l & l saura vous satisfaire
Ventilation de toiture
Ayant effectué une centaine de travaux de ventilation de toiture, Toitures L & L possède les connaissances et l'expérience nécessaire à l'aération de votre toiture.
NB: I've removed your no-margin
IDs, as these are duplicates, and duplicate IDs are not valid markup. I've also replaced your images with placeholders for the purposes of this demo.
Bootstrap 3.3 doesn't have the convenience of flexbox, so instead you'll have to float
the columns. To achieve the same effect, what you'll want to do is float the first column (the content) to the right
when you want the image displayed on the left, making use of the selector .row:nth-of-type(even) > .col-lg-6:first-of-type
.
This can be seen in the following:
.row:nth-of-type(even) > .col-lg-6:first-of-type {
float: right;
}
Réfection de toiture
Que ce soit un toit de bardeau, de tôle ou à faible pente, Toitures l & l saura vous satisfaire
Ventilation de toiture
Ayant effectué une centaine de travaux de ventilation de toiture, Toitures L & L possède les connaissances et l'expérience nécessaire à l'aération de votre toiture.