
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to create clickable areas in an image in HTML?
To create clickable areas in an image, create an image map, with clickable areas. For example, on clicking a box, the different website opens and on clicking a triangle in the same image, a different website opens.
The <area> tag defines an area inside an image-and nested inside a <map> tag. The following are the attributes:
Sr.No | Attribute & Description |
---|---|
1 | alt |
2 | coords |
3 | download |
4 | shape |
5 | target |
Example
You can try to run the following code to create clickable areas in an image in HTML
<!DOCTYPE html> <html> <head> <title>HTML area Tag</title> </head> <body> <img src = /images/usemap.gif alt = "usemap" usemap = "#lessons"/> <map name = "lessons"> <area shape = "poly" coords = "74,0,113,29,98,72,52,72,38,27" href = "/perl/index.htm" alt = "Perl Tutorial" target = "_blank" /> <area shape = "rect" coords = "22,83,126,125" alt = "HTML Tutorial" href = "/html/index.htm" target = "_blank" /> <area shape = "circle" coords = "73,168,32" alt = "PHP Tutorial" href = "/php/index.htm" target = "_blank" /> </map> </body> </html>
Output
- Related Articles
- How do we create an image map in HTML?
- How to create an unordered list with image bullets in HTML?
- How to display an image in HTML?
- How to create clickable links in a textView on Android?
- How to Create an Image Slider using HTML, CSS, and JavaScript?
- How to Insert an Image in HTML Page?
- How to make an image responsive in HTML?
- How to create an image map in JavaScript?
- How to create an Image Slider in ReactJS?
- How to use an animated image in HTML page?
- How to create clickable links in a TextView on Android using Kotlin?
- How to create an ordered list in HTML?
- How to specify an image as a client-side image-map in HTML?
- How to Create Image Hovered Detail using HTML & CSS?
- How to use an image as a link in HTML?

Advertisements