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 ...

Get Cascading Style Sheets (CSS) by Example 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.