Register to Better Coder! It's free.
Enjoy the premium features and succeed at every job interview.

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" />


No Comments Yet.
Be the first to tell us what you think.
HTML for beginners
HTML for beginners

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

Test yourself