Inserting Graphics
Inserting a graphic on a Web page is as simple as placing an <img /> tag where you want the graphic to appear, like this:
<img src="logo.gif" />
Note
Note that this is a one-sided tag, and therefore needs to be closed with a space and slash (/) at the end in XHTML.
As you learned in Chapter 5, when a file is stored in the same folder as the HTML document in which it is referenced, you can refer to the file name only, without any location information. If you want to store your graphics in a subfolder of the folder containing the text files (to organize your files more tidily), you must refer to the graphic with the subfolder name, like this:
<img src="images/logo.gif" />
To refer to a file that is up one level in the folder structure, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access