HTML5: How to define a client-side image-map?
Solution:
HTML Code:
Explanation:
- The HTML document begins with a declaration of its type and version (<!DOCTYPE html>).
- The <html> element encloses the entire HTML document.
- The <head> section contains metadata about the document, including the character encoding and the title.
- Inside the <body> section, an <img> element is used to display an image.
- The <img> element is associated with a client-side image map defined by the <map> element with the name "Map".
- Inside the <map> element, there are multiple <area> elements defining clickable areas within the image.
- Each <area> element specifies the shape, coordinates, target URL, alternative text, and language of the linked resource for a particular clickable area in the image.
Live Demo:
See the solution in the browser
Supported browser
![]() |
![]() |
![]() |
![]() |
![]() |
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.