What is <img> tag and how is it used?
Experience Level: Junior
Tags: HTML
Answer
The <img>
tag defines an image in an HTML page.
It has a two required attributes: src
and alt
.
src
- is use for the URL of image
alt
- is alternative text
- use for when image can not be loaded on web page
Related HTML job interview questions
Can you give 10 examples of the most used attributes?
HTML JuniorWhat is <a> tag and how is it used?
HTML JuniorWhat is a <form> tag?
HTML JuniorWhat is a <pre> tag?
HTML JuniorWhat is a <code> tag?
HTML Junior