Computer Science, asked by mohit5585, 1 year ago

what is the purpose of scr and alt attributes of the<img> tag?

Answers

Answered by kurokiri67
1
The <img> tag defines an image in an HTML page. The <img> tag has two required attributes: src and alt.

The required src attribute specifies the URL of the image. Note: When a web page loads; it is the browser, at that moment, that gets the image from a web server and inserts it into the page.

The required alt attribute specifies an alternate text for an image, if the image cannot be displayed. The alt attribute provides alternative information for an image if a user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user uses a screen reader).
Similar questions