Arranging Elements on the Page

The image in the preceding exercise was carefully prepared to be the correct size to fit in the space where it was to be inserted. But what if the image is larger?

Perhaps that’s the look you want; but perhaps not. However, this example could certainly be improved by changing the placement of the Recent Articles heading. It should be at the left margin, and not wrapped around the graphic.

Arranging Elements on the Page

To move down text vertically until the space occupied by the graphic becomes "clear," use the clear style rule. You apply this rule to the text’s tag, not to the graphic’s tag. For example:

<h2 style="clear: left">Recent Articles</h2> ...

Get HTML and XHTML Step by Step 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.