From the course: CSS Essential Training

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Layouts with the float property

Layouts with the float property - CSS Tutorial

From the course: CSS Essential Training

Start my 1-month free trial

Layouts with the float property

- Historically, the float property was used to create page layouts. However, we now have grid and Flexbox, which provide better solutions. Though the use of floats in layouts have decreased, you may still need to support them. For example, you may end up working on a project that uses an old code base, often referred to as legacy code. Plus, floats are still relevant today and can be used for simple layouts, so it's important to understand how they work. Early websites mostly recreated print designs using the float property to create magazine style layouts with floated images and text flowing around those images. Developers soon realized they could float other elements too, leading to float-based page layouts. Most HTML documents are block level and are displayed at a full width, stacking on top of each other in the normal document flow. The float property can be used to change the position of elements by floating…

Contents