Floating an image to the right making text wrap around it is easy if the image comes before the text in the html.
But can it be done if the image comes after the text?
Like this:
<div class="text">Lorem ipsum</div>
<img src='...' alt=''>
See JsFiddle – how can the image be floated to the right of the text in such a case where I’m unable to change the html?
>Solution :
But can it be done if the image comes after the text?
No, that’s not possible. float specifies how the content following the element you applied it to, behaves.
If you just want the image on the right, text on the left (without the text actually floating around the image, meaning going below the image as soon as there’s space), then use flexbox.