Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap Align Image with text

I am trying to align an image on the left side with text using boostrap, and when page is viewed on mobile devices the images becomes centred on top of the text !

<div class="container">
<div class="row">
    <h1>About Me</h1>
    </class>
     <div class="col-md-4">
     <div class="imgAbt">
        <img  width="220" height="220" src="img/me.jpg">
     </div>
     </div>
    <div class="col-md-8"><p>Lots of text here...With the four tiers of grids available you're bound to run into issues where, at certain breakpoints, your columns don't clear quite right as one is taller than the other. To fix that, use a combination of a .clearfix and o</p></div>
</div>
</div>

I have also tried .col-md-3 .col-md-pull-9 along with .col-md-9 .col-md-push-3 , however I still was not able to achieve desired results, similar to this design

like image 625
rikket Avatar asked Mar 25 '14 16:03

rikket


People also ask

How do I align an image and text side by side in Bootstrap?

To create image and text side by side use the grid system property of bootstrap and create 2 columns of span 6-6. Put your image in one column and your text in another. On smaller devices, it will automatically align vertically.

How do I center text and image in Bootstrap?

Answer: Use the center-block Classcenter-block on it, along with the . img-responsive class in Bootstrap 3.

How do I center align an image in Bootstrap 4?

By default, images are display:inline . If you only want the center the image (and not the other column content), make the image display:block using the d-block class, and then mx-auto will work.


1 Answers

use the grid-system of boostrap , more information here

for example

<div class="row">
  <div class="col-md-4">here img</div>
  <div class="col-md-4">here text</div>
</div>

in this way when the page will shrink the second div(the text) will be found under the first(the image)

like image 84
WhiteLine Avatar answered Nov 16 '22 03:11

WhiteLine