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

Latest Article

HTML

HTML Character Sets

ASCII was the first character set. It describes 127 different alphanumeric characters that can be used on the internet.

HTML

HTML Event Attributes

The following event attributes could be added to all HTML elements where applicable. The event attributes are used for specifying the characteristics of an element

HTML

HTML Tags

HTML Tag are used for making front end part which is visible for visitors. HTML Tag are ,