Inserting Images

Inserting an image into an (x)html document is a rather strait forward process. The tag you’ll need to accomplish is called the <img> tag. Like meta tags, <br />, and <hr /> the image tag is a self closing tag.

The following example will insert an image into your document

You can use the sample image located here for this example.

Or generate a random placeholder image from a web service:


  • src – points to the source file you wish to display. The src attribute will accept either a relative or absolute path to the file.
    Note: it is considered bad form to link absolutely to an image on someone else’s server. This is known as hotlinking.
  • width – not required
  • height – not required
  • alt – required – the is the text that will be read to an individual using assistive technologies to browse the page.