- HTML Tutorial
- HTML - Home
- HTML - History and Evolution
- HTML - Overview
- HTML - Editors
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Headings
- HTML - Paragraphs
- HTML - Quotations
- HTML - Comments
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Style Sheet
- HTML - CSS Classes
- HTML - CSS IDs
- HTML - Images
- HTML - Image Map
- HTML Tables
- HTML - Tables
- HTML - Headers & Caption
- HTML - Table Styling
- HTML - Table Colgroup
- HTML - Nested Tables
- HTML Lists
- HTML - Lists
- HTML - Unordered Lists
- HTML - Ordered Lists
- HTML - Definition Lists
- HTML Links
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Iframes
- HTML - Blocks
- HTML Backgrounds
- HTML - Backgrounds
- HTML Colors
- HTML - Colors
- HTML - RGB
- HTML - HEX
- HTML - HSL
- HTML Forms
- HTML - Forms
- HTML - Form Attributes
- HTML - Form Control
- HTML - Input Attributes
- HTML Media
- HTML - Video Element
- HTML - Audio Element
- HTML - Embed Multimedia
- HTML Header
- HTML - Head Element
- HTML - Adding Favicon
- HTML - Javascript
- HTML Layouts
- HTML - Layouts
- HTML - Layout Elements
- HTML - Layout using CSS
- HTML - Responsiveness
- HTML - Symbols
- HTML - Emojis
- HTML - Style Guide
- HTML Graphics
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - Drag & Drop API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web Storage
- HTML - Server Sent Events
- HTML Miscellaneous
- HTML - MathML
- HTML - Microdata
- HTML - IndexedDB
- HTML - Web Messaging
- HTML - Web CORS
- HTML - Web RTC
- HTML Demo
- HTML - Audio Player
- HTML - Video Player
- HTML - Web slide Desk
- HTML Tools
- HTML - Velocity Draw
- HTML - QR Code
- HTML - Modernizer
- HTML - Validation
- HTML - Color Code Builder
- 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
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
HTML - <map> Tag
HTML <map> tag is used to define an image map to make clickable area on the image. This is an excellent assistance for enhancing the interactivity of websites.
If we want to make the graphics more interactive we can use image mapping.Wwe can navigate between images within the same frame and interact with the image. When we wish to accomplish a feature like zooming in on the website's image, this feature is helpful. There will be a clickable area on each image, and we can set the URLs or other images to redirect when the user clicks on that area.
Syntax
<map name="">...</map>
Attribute
HTML map tag supports Global and Event attributes of HTML. And a specific attribute as well which is listed bellow.
Attribute | Value | Description |
---|---|---|
name | mapname | Defines a unique name for the map tag. |
An image map is defined by the combination of the HTML <area> and <map> tags. An image map consists of an image with clickable portions; by clicking the image, a new window or the specified location will open. The <area> element, which specifies the location and type of the area, may contain more than one instance. Without separating the image, you may quickly link any portion of image to other documents using the <map> element.
Examples of HTML map Tag
Bellow examples will illustrate the usage of map tag. Where, when and how to use map tag and how we can manupulate map element using CSS.
Maping on an Image
Let’s look at the following example, where we are going to use the <map> tag and navigate to another page by specifying the link.
<!DOCTYPE html> <html> <body> <h3>HTML map Tag</h3> <img src="https://www.tutorialspoint.com/cg/images/logo.png" alt="Workplace" usemap="#workmap" width="400" height="70"> <map name="workmap"> <area shape="rectangle" coords="33,45,271,300" alt="tutorial" href="https://www.tutorialspoint.com/index.htm"> </map> </body> </html>
Navigating Images with the map Tag
Consider another scenario where we are going to use the <map> tag to navigate to another image within the same frame.
<!DOCTYPE html> <html> <body> <center> <p>Click on Images where the cursor clickable. </p> <img src="https://www.tutorialspoint.com/cg/images/logo.png" alt="logo" usemap="#tutorial"> <map name="tutorial"> <area shape="rect" coords="0, 0, 52, 52" alt="tutorial" href="https://www.tutorialspoint.com/html/images/html.jpg"> </map> </center> </body> </html>
Supported Browsers
Tag | |||||
---|---|---|---|---|---|
map | Yes | Yes | Yes | Yes | Yes |
To Continue Learning Please Login
Login with Google