Text caption won't wrap (Bootstrap)

If I add width: 226px; to figure figcaption it works but I need a way it works for all size images.

Specifically this. It is on link that i originally posted. How to wrap text around image and be responsive at the same time.

Yes but I want the text to be below the image, and wrap at the size of the image.

Aha … go to latest link i left for you and paste this code:

<div class="clearfix">
<img class="img2" src="pineapple.jpg" alt="Pineapple" width="170" height="170">
<span style="float: right;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum...</span></div>

instead original one. Run it and observe the difference.

Yes, but the text doesn’t wrap. It goes to the full width of the page.

Is this what you looking for?

No, this is what I am looking for: Selection_111

Ok then.

You need the text to occupy the width of the image right.? is this the way you’re expecting the text to behave…?

Thanks for all the help. I have given up and went back to what I used to use (I was trying to do it using HTML5 tags):

    <div class="picture rightPicture" style="max-width:2 PX WIDER THAN IMAGEpx;">
     <img src="IMAGE NAME" width="###" height="###" class="img-fluid" alt="###############"> IMAGE CAPTION GOES HERE.
    </div>

Thanks again. (Sorry for the delay but something came up.)