Adding Images to Web Pages

Images and Graphics on Web Pages

Workers using software to calibrate springs in office
Monty Rakusen/Cultura/Getty Images

To add an image, icon, or graphic to your web page, you need to use the tag. You place the IMG tag in your HTML where you want the graphic to display:


Images are easy to add to your web pages. The IMG tag has only two required attributes: and . The SRC attribute tells the browser which image to display, and ALT tells the browser what to display if it can't show the image.

The IMG tag also has two other attributes that you should use when you put a graphic on your web page:


The WIDTH and HEIGHT attributes tell the browser the size of the image. The browser then knows exactly how much space in the layout to allocate, and it can move on to the next element on the page while the image downloads. You should use the actual dimensions of your image, rather than having the browser resize it for you.

How to Find the Height and Width of Your Images

If you load the image in Firefox, the width and height are displayed in the title: filename.gif (GIF image, width x height pixels). Internet Explorer displays the height and width that are written in the HTML not the actual image size if you right click on the page and choose properties.

The IMG Tag


Current Articles