HTML Image

HTML Image tag <img> displays image in a webpage. In this tutorial, we will learn how to define  HTML Image element with different case studies.

<img src=""/>

Examples

The following is a basic example to display HTML Image in a webpage.

ADVERTISEMENT

index.html

When the image at the provided src is not available, browsers display a broken image symbol.

alt attribute helps to display an alternative text when image is not available. This increases readability of the webpage when the image is not available.

index.html

Alt attribute is very useful when you consider SEO for your website. alt attribute acts as a description to the images and let the search engines know what the image is about.