Simple HTML Graphics

The <img src> tag places images on your Web pages. After you designate an image's location and filename, the image appears. Graphics are simple to display and, unless you want to apply advanced formatting techniques to your Web page images, the <img src> tag is all you'll need for many of your Web page graphics.

Here is a simple Web page command that displays an image on the screen:

<img src="images/myphoto.jpg"

The image appears wherever this img src tag appears inside the HTML code. It's up to you to ensure that the image is formatted in a type of file that browsers can display. The common image formats are JPEG and GIF, and most graphics programs produce images in these two formats.

You can easily place a border around ...

Get Absolute Beginner's Guide to Programming, Third Edition 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.