> For the complete documentation index, see [llms.txt](https://olise-eke.gitbook.io/frontend-tutorial-for-beginners/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://olise-eke.gitbook.io/frontend-tutorial-for-beginners/overview/html/html-images.md).

# HTML Images

This HTML tag will teach you how to add an image to a web page.

HTML provides a way to display images on a web page using the \<img> element. The \<img> element is a self-closing tag, meaning it doesn't require a closing tag, and has the following syntax:

&#x20;`<img src="image_file.jpg" alt=" description of image">`

The src attribute specifies the source of the image, which can be a URL or a file path. The alt attribute provides a text description of the image, which is used for accessibility purposes, such as for users with visual impairments who use screen readers.

&#x20;It is also a good practice to include the width and height attributes to specify the dimensions of the image, as this can improve the loading speed of the page.

&#x20;Here's an example:

```
<img src="my_image.jpg" alt="A beautiful landscape" width="500" height="300">
```

This will display an image with the file name "my\_image.jpg", a description of "A beautiful landscape", and dimensions of 500 pixels wide by 300 pixels high.
