HTML Image

By Tony 2023.3.3 Last updated 2024.1.25


Images help a lot on visualizing and understanding different concepts, information, and other things. They also make your webpage richer with content and information. This article will show you how to put images on your webpage.

An image

This is an image tag's HTML code:

<img src="example.png" alt="Image">
Note: <img> tag doesn't have a closing tag.

The src attribute of the <img> tag tells the browser the image source so it can display it properly, and alt attribute tells the browser what the alternative text of the image is for accessebility or if the image doesn't show. These are two most important attributes for <img> tag. For more information, visit our references.