Chapter 9 Displaying Graphics

To insert an image

Inserting Graphics

<img src="filename.ext" />

To refer to a file that is up one level in the folder structure:

<img src="../filename.ext" />

To wrap text around an image and force the image to the left or right side of the screen

Inserting Graphics

Within the tag:

<img src="filename.ext" style="float: left" />

or

<img src="filename.ext" style="float: right" />

In a style sheet:

img {float: left}

or

img {float: right}

To delay text vertically until it is clear of an earlier graphic

Arranging Elements on the Page

<tag style="clear: left">text</tag>

or

<tag style="clear: right">text</tag>

where tag is any text-related tag such as <p> or <h1>.

To specify an image size

Controlling Image Size and Padding

To specify height only ...

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.