HTML supports various multimedia resources such as images, audio, and video.
The html <img> element embeds an image into the document.
The src
attribute is required and contains the path to the image you want to embed.
The alt
attribute holds a text description of the image, which isn't mandatory but is incredibly useful for accessibility
<img src="misc/img1.jpg" alt="light house">
The html <img> element can have width
and height
attribute to define dimension of image.
<img src="misc/img1.jpg" width="250" height="180" >
The object-fit
property is used to specify how an img should be resized to fit its container.
<img src="misc/img1.jpg" width="250" height="180" >