DISCOVER
×

How to add an image using html

Updated February 21, 2017

A picture is worth a thousand words, or so the adage goes, and pictures can certainly add colour and visual interest to an otherwise plain website. Adding an image to a page using HTML is simple, requiring the use of only one tag, .

Note the image's height and width in pixels.

Upload the image to your webhost and make a note of its URL.

Place the following code within your webpage's HTML where you want the image to appear. Replace the example URL, height and width with your image's actual URL; the "alt" attribute should contain a short description of the image itself.

Example image

Tip

Although the "height" and "width" attributes are not required, using them will allow browsers to reserve a space for the image even if it has not yet loaded, keeping your page's layout static.

Cite this Article A tool to create a citation to reference this article Cite this Article

About the Author

Laurel Storm has been writing since 2001, and helping people with technology for far longer than that. Some of her articles have been published in "Messaggero dei Ragazzi", an Italian magazine for teenagers. She holds a Master of Arts in writing for television and new media from the University of Turin.