LurpThurst
LurpThurst

Reputation: 21

Adding Text and Images in the same row using bootstrap

I am currently trying to put text right of an image using the bootstrap classes. I am fairly new to using bootstrap. I used the float class but the image just gets put under the text. I want to have it so the img tag is under the text tag in the code. I also do not want to use any css in this project. I know it is impractical but I am curious if you can make the text and Images side by side with the img tag under the text tag

Upvotes: 0

Views: 2463

Answers (2)

Kyle McCaf
Kyle McCaf

Reputation: 47

Text right of an image using the bootstrap classes, but with the img tag under the text tag in the code

<div class="row">
    <div class="col-6 p-0 order-2">Text</div>
    <div class="col-6 p-0 order-1">Image</div>
</div>

Upvotes: 1

Andrea Viviani
Andrea Viviani

Reputation: 267

If you want the img on the left but under the text in the code you have to invert order:

<div class="row">
 <div style="padding:0" class="col-6 order-2">Text</div>
 <div style="padding:0" class="col-6 order-1">Image</div>
</div>

Upvotes: 0

Related Questions