<img> tag

<img> tag defines an image in HTML. <img> tag is an empty tag, i.e. it does not have closing tag. It has attributes.

  • src attribute specifies the path of the image.
  • If the user for some reasons cannot view the image, then text will show for that image provided by alt attribute.
  • style attribute specifies the width, height and background-image of the image.

Syntax

<img src="path" alt="alternate text">

Example


<html>
<body>
 <img src="https://www.conceitcode.com/
images/logo.png" alt="ConceitCode Logo"
style="width:200px;height:100px;"> 
</body>
</html>


Output

ConceitCode Logo
Subscribe & Get Regular Updates On Your E-mail