Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > CSS

  • Print
  • + Share This
Like this article? We recommend

Like this article? We recommend

A Few Words About Floats

Floating is the process of taking a box and having it float to the left or right. The concept is exactly the same as aligning an image to the right and having text flow around it. In fact, floating in CSS was designed to allow us to do just that. The following will place an image to the right of the text, which will flow around it:

img {float: right;}

Because you can float any box, it appears as if this is a positioning scheme, but it's not. However, floating is often used along with positioning to create floating boxes within a design, so people are sometimes under the impression that floating is a positioning scheme.

Floating boxes are in the normal flow and therefore cannot be manipulated in the same way as positioned boxes. Although both are used to create layouts in contemporary CSS design, it is important to understand the difference.

  • + Share This
  • 🔖 Save To Your Account