April 2005
Intermediate to advanced
336 pages
6h 33m
English
As mentioned in the chapter's introduction, floating is not a positioning scheme. It gets confused with positioning sometimes because it can be used alone or with positioned boxes to create layouts.
The reason floating was introduced in CSS at all wasn't for layout, per se. The intent was to be able to float elements, particularly images, and have content flow around the image (see Example 12-7).
Example 12-7. Floating an image
<style type="text/css">img { float: right; padding: 15px; }</style>
Figure 12-11 shows the results. I've added styles to spice up the look.
Figure 12-11. Floating an image allows text to flow around the image, resulting in a sophisticated look.
Just as you can float an img ...
Read now
Unlock full access