6.1. More on Positioning Page Blocks

6.1.1. The float Property

One of the most interesting and often-used CSS properties is the float property . It takes a value of left, right, or none (though none is the default and is rarely used). This property, when set to left or right, forces the element to float outside of its natural position in the containing box, aligned either to the left or the right, respectively. Subsequent content wraps around the element. It can be used in any block element.

Two frequent uses of the float property are to create drop-cap designs, and flow text around images. To create a drop-cap effect using the float property, define a <span> element whose float property is set to left[1]. The font-size property is set to some ...

Get HTML Utopia: Designing Without Tables Using CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.