Image Tag – HTML

What is image <img> tag?

<img> tag is used to embed an image on a web page

Example

<img Src = " /image.png" alt = " description of the image ">
<!DOCTYPE html>
 
<html>
<body>
 
<h1>The img element</h1>
 
<img src="https://technologynile.com/wp-content/uploads/2024/02/cropped-20240205_201604_0000-removebg-preview.png"alt= "logo">
 
</body>
</html>

Understanding Attributes of image tag

Height : This attribute is used to specify the height of an image in pixels.

Width : This attribute is used to specify the width of an image in pixels. The “width” and “height” attributes are used to specify the dimensions of the image in pixels.

Src : The source location (URL) of the image file.

Alt : This attribute specifies the alternate text of theimage.

Share this Article

Leave a comment

WhatsApp Channel Join Now
Telegram Channel Join Now
Instagram Page Join Now