Wrap text around an image on bootstrap 3
I have 2 columns on this page, each with a text-wrapped image, a title, subtitle, text and link. I nest the image in its own column within the text column to wrap the text. This code converts to full column width when displayed on mobile. I'm sure you could pull-right if you wanted to, but this works for me. See code in action at http://www.lbch.org/_Employment.html.
<div class="container">
<div class="row">
<div class="col-xs-12">Page Head Title & Text</div>
<div class="col-xs-12 col-md-6">
<div class="col-xs-12 col-md-5">
<img src="image" class="img-responsive" alt=""/> <br>
</div>
<div class="text-left">
<h4 class="text-center">
<strong>Article Title</strong><br>
<small>Article sub-title</small>
</h4>
<p>Text</p>
<p><a href="link">link text</a><strong> </p>
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="col-xs-12 col-md-5">
<img src="image" class="img-responsive" alt=""/> <br>
</div>
<div class="text-left">
<h4 class="text-center">
<strong>Article Title</strong><br>
<small>Article sub-title</small>
</h4>
<p>Text</p>
<p><a href="link">link text</a><strong> </p>
</div>
</div>
</div> <!--row-->
</div> <!--container-->
When using 2 columns the text will never get wrapped around the image.
You should put the image and text in one column and give it full with. Then wrap the text and image in a div and float them to the left. Something in the line of this (code is an example and not tested):
<div class="col-md-12">
<div class="pull-left"><img src="YourImage.png"/></div>
<div class="pull-left">Your text goes here......</div>
</div>
You might need some margin on the image so the text doesn't stick to close to the image
None of these worked for me. My working code using rails 5.2 and bootstrap 4.1:
<div class="row">
<div class="col">
<img src="<%=url_for(@user.image)%>" class="float-left" style="height:150px;margin-right:10px">
<p>A bunch of text</p>
<p>More text</p>
</div>
</div>
This works for me.
<div class="col-md-12">
<img src="img/image.jpg" class="pull-left">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Iste molestiae aliquam optio mollitia, unde quas eaque voluptatem dignissimos eos maiores magni reprehenderit nisi, corrupti nemo hic id cum quasi officiis!</p>
</div>