Table of contents
Image Tag
- The
<img/>
HTML element embeds an image into the document.
Attributes
- 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, not mandatory but useful for screen readers.
- The width and height attributes always define the width and height of the image in pixels.
Image mapping
- Here comes the interesting part of the image tag. It's the usemap property.
- We can have an image with clickable areas and can even direct to another page.
- Click here for Demo
Tips
- Always mention the height and width of the image.
Reference
- developer.mozilla.org/en-US/docs/Web/HTML/E..
- w3schools.com/html/html_images.asp
- developer.mozilla.org/en-US/docs/Web/API/HT..
- w3schools.com/tags/att_img_usemap.asp
Thank you for reading.