Images in HTML

62 - 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.

Search Gyanva

Press "Enter" to search.

More from Publication

What we offer ?

We offer you a platform to publish your experience, knowledge and research with rest of the world. All you need is to sign up and create your own publication on Gyanva.
logo
facebook youtube