Without going into why this is necessary: let's say we have a picture wrapped with a link, but we need the float:left ) to be exactly the picture, not the link. Naturally, the picture will fall out of the link. How to prevent it?
I repeat once again that for reasons that we will not go into, the decision to float the link instead of the picture does not fit (otherwise I would not ask this question).
img { float: left; width: 300px; } <div> <a href="#"> <img src="images/image.png" alt="image"> </a> </div>
clearfixadd a link to which the image is wrapped. - greybutton