In HTML, you can add images to a webpage using the <img> tag. This tag is self-closing and requires at least one attribute, src, which specifies the source of the image. Here's the basic syntax for including an image:
The HTML <img> tag is used to embed an image in a web page.
Images are not technically inserted into a web page; images are linked to web pages. The tag creates a holding space for the referenced image.
The <img> tag is empty, it contains attributes only, and does not have a closing tag.
he required src attribute specifies the path (URL) to the image.
Example:
<img src="myimage.jpg" alt="My Image">
The required alt attribute provides an alternate text for an image, if the user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user uses a screen reader).
The value of the alt attribute should describe the image:
Example:
<img src="india.jpg" alt="Image of India">
You can use the style attribute to specify the width and height of an image.
Example:
<img src="img1.jpg" alt="Image 1" style="width:500px;height:600px;">