June 2025
Beginner
817 pages
31h 30m
English
Another important CSS feature for creating a layout with CSS is float. This feature enables you to take an element out of the usual document flow and place it on the right or left edge of the embracing element. The subsequent elements (without float) flow around this floated element. The CSS feature float was used for years to create layouts for websites. You can certainly still use this technique today, but there are now better techniques available for this, such as flexboxes or the grid layout. The classic example, which is still often used today to demonstrate the CSS feature float in use, is the flowing of text around an image. Let’s first take a look at the following HTML lines:
... <body> ...Read now
Unlock full access