If you want your image to remain inside the bootstrap column, you will need additional css:
img { max-width: 100%; max-height: 100%; }
Your html will look like this if you want to have an image inside an A div (it will be to the left of the screen):
<div class="row"> <div class="col-sm-1"> <img src="http://hearstcommerce.ca/customcontent/members/premium/sample.jpg" alt=""> </div> <div class=" col-sm-1 ">B</div> <div class=" col-sm-1 ">C</div> <div class=" col-sm-1 ">D</div> <div class=" col-sm-1 ">E</div> <div class=" col-sm-1 ">F</div> <div class=" col-sm-1 ">G</div> <div class=" col-sm-1 ">H</div> <div class=" col-sm-1 ">I</div> <div class=" col-sm-1 ">J</div> <div class=" col-sm-1 ">K</div> <div class=" col-sm-1 ">L</div> </div>
You do not need to use col-sm , col-md and col-lg together. If you use only col-sm , it does the same effect of others on large and medium screens.
If you want the image to be always in the center, you will need to use an offset. An offset is just an empty column that goes to the left of your columns. Depending on the size you want, if you do it higher, your image will always be in the center:
<div class="row"> <div class="col-sm-2 col-sm-offset-5"> <img src="http://hearstcommerce.ca/customcontent/members/premium/sample.jpg" alt=""> </div> </div>
Just remember that a row can only contain 12 columns. In the above order, I placed 5 empty columns to the left of the image, which occupies 2 columns, and then to the right of 5 columns to the right to complete 12 columns.
source share