What is <img> tag and how is it used?

Experience Level: Junior
Tags: HTML


The <img> tag defines an image in an HTML page.

It has a two required attributes: src and alt.


  • is use for the URL of image
  • is alternative text
  • use for when image can not be loaded on web page

<img class="img-center" src="circleimg.png" alt="test-picture1" width="100" />
Related HTML job interview questions
HTML for beginners
HTML for beginners

Are you learning HTML? Try our test we designed to help you progress faster.

Test yourself