This course will be retired on July 12, 2021. We recommend "Mobile-First CSS Layout" for up-to-date content.
Wrapping Text Around Images with Floats5:03 with Guil Hernandez
One of the easiest ways to use floats is with an image. Text will wrap around an image with the float property applied to it, like in a magazine layout.
floatproperty accepts the values
- A floated element is technically a block-level element (it accepts any width, height, padding or margins values), but it behaves like an inline element because it doesn't exist on a line of its own, and surrounding content flows around it.
- If you’re ever curious about how your floated layout actually works, apply a dark border or background to the elements to see what’s going on behind the scenes.
You need to sign up for Treehouse in order to download course files.Sign up