Images in HTML

49
Mr. Coder | 26-Oct-2024
Description

In order to display the images in HTML page we use <img> tag. It is a unpaired tag and requires two attributes which are src and alt

In src we provide the source url of the image.

In alt we provide some text which is displayed when image fails to display.

Code Example :
<img src="https://common-content.thegyanva.com/images/PostContents/gs650_4.jpg" alt="sample image" />

Output :
sample image

Output of broken link (demo of alt attribute) :
sample image

This is we use image tag in HTML.

Comments
Load more comments.
Please Login or Sign up to comment.
logo
facebook youtube