To add an image, icon, or graphic to your web page, you need to use the
IMG 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:
SRC attribute tells the browser which image to display, and
ALT tells the browser what to display if it can't show the image.
IMG tag also has two other attributes that you should use when you put a graphic on your web page:
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.
<img src="URL to the image" width="width in pixels" height="height in pixels" alt="alternative description of the image">