1. Technology

Adding Images to a Web Page


4 of 6

How To Use <img> Add An Image To A Web Page
Image tag and attributes

Image tag and attributes

Screen shot courtesy Jon Morin

Here is a look at the way the IMG element is used. Choose the location where you would like the image to appear. In this example, the image of a bunch of flowers will appear under a heading that says “Here is a picture of some flowers.” At the place on the page that you chose, type the HTML tag:

<img src=”bunch-of-flowers.jpg”>

Your image will have a different filename, of course. The entire tag is in between the less-than and greater-than signs and is made up of:

  • the tag name (IMG)
  • the attribute (src). There needs to be a space between ‘img’ and ‘src’
  • an equals sign
  • the filename of the image you are using, in between quotes

Here's how it looks in the HTML code of a web page:

  <title>Using The IMG Tag To Add An Image To A Web Page</title>
<h1>Here is a picture of some flowers.</h1>
<img src="bunch-of-flowers.jpg">

©2014 About.com. All rights reserved.