In HTML, images use the <img> tag. The <img> tag does not have a closing tag. Image tag contains two attributes src and alt. Src specifies the URL of the image and alt tag specifies the alternative name of image.

Example:–

<!DOCTYPE html>

<html>

<body>

<img src=”Image URL” alt=”alternative image name” other attributes-list/>

</body>

</html>

Image Width/Height

You could use image width and height based on your condition using width and height attributes.
Example:–

<!DOCTYPE html>

<html>

<body>

<img src=”Image URL” alt=”alternative image name” width=”400” height=”50” />

</body>

</html>

Image Map

The <map> tag used to identify an image-map. An image-map is a clickable area. The name element of the <map> tag is linked with the <img> usemap which creates a relationship b/w the image and the map.

Example:–

<!DOCTYPE html>

<html>

<body>

<img src=”today.png” alt=”today” usemap=”#today” style=”width:125px;height:120px;”>

<map name=”today”>
<area shape=”rect” coords=”0,0,62,166″ alt=”moon” href=”moon.htm”>
<area shape=”circle” coords=”80,68,5″ alt=”earth” href=”earth.htm”>
<area shape=”circle” coords=”132,60,12″ alt=”Venus” href=”venus.htm”>
</map>

</body>

</html>

Related Article