Return Home

Floating Images on a webpage

It's possible to wrap text around images on a webpage using the float property in CSS! to wrap text around an image, we first place an element with text below the image element, then in our stylesheet we set the float property to left or right.

If we want to have a second element below the first, but we dont want it to wrap, then we can use the clear property to remove the float from the second element

Adding the clear property to a text element stops it from wrapping around the floated image. Subsequent text elements will also be affected by this.