O'Reilly logo

Cascading Style Sheets (CSS) by Example by Steve Callihan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Floating Elements

The float property allows an element to float relative to following elements. This means that following elements flow (or wrap) around the floating element.

For this section, just continue to use the example HTML file, perform-motive2.html, that you were using in the previous section.

Creating a Drop-Cap Effect

Here's an example of using the float property to create a drop-cap effect (see Figure 10.4):

<p><span style="color: lime; background: transparent; font-size: 2.6em; line-
							height: 0.9em; float: left; width: 0.7em; padding-right: 2px">A</span>re you living and working up to your potential? Do you wish to know how to motivate yourself, family, associates, or employees to higher performance and achievement? Are you spending ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required