Skip to content

Buzzingz

Unleashing the Power of Code

  • HTML
  • CSS
  • JavaScript
  • Toggle search form

Image Map

Posted on March 4, 2023April 1, 2023 By shani No Comments on Image Map

An image map is a feature in HTML that allows specific areas of an image to be linked to different web pages or sections within a single web page. To create an image map, you need to use the <map> element to define the clickable areas on the image and associate them with specific URLs.

Example:

<img src="worldmap.gif" alt="World map" usemap="#worldmap">

<map name="worldmap">
  <area shape="rect" coords="0,0,100,100" href="northamerica.html" alt="North America">
  <area shape="rect" coords="100,0,200,100" href="southamerica.html" alt="South America">
  <area shape="rect" coords="200,0,300,100" href="europe.html" alt="Europe">
  <area shape="rect" coords="300,0,400,100" href="asia.html" alt="Asia">
  <area shape="rect" coords="400,0,500,100" href="australia.html" alt="Australia">
  <area shape="rect" coords="500,0,600,100" href="africa.html" alt="Africa">
</map>

In this example, the <img> element displays a world map image, and the usemap attribute specifies the name of the image map (#worldmap).

The <map> element contains a series of <area> elements, each of which defines a clickable region on the image using coordinates and a shape (rect for rectangular areas or circle for circular areas). The href attribute specifies the URL of the linked page, and the alt attribute provides a text description of the link for accessibility purposes.

Image maps can be useful for creating interactive diagrams or providing navigation within an image-heavy website, but they can also be challenging to create and maintain, as they require precise positioning and sizing of clickable regions. It’s important to test your image maps on different devices and screen sizes to ensure that they work properly for all users.

HTML

Post navigation

Previous Post: HTML images
Next Post: Background Image

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

HTML Tutorial

  • HTML History
  • HTML Editors
  • What is an HTML Element?
  • HTML Attributes
  • HTML Headings
  • HTML Paragraphs
  • HTML Styles
  • HTML Text Formatting
  • HTML Quotation and Citation Elements
  • HTML Comments
  • HTML Colors
  • HTML Styles – CSS
  • HTML Links
  • HTML images
  • HTML Favicon
  • HTML Tables
    • HTML Table Colgroup
    • HTML Table Colspan and Rowspan
    • HTML Table Headers
    • HTML Table Padding and Spacing
    • HTML Table Sizes
    • HTML Table Styling
  • HTML List
  • HTML Ordered Lists
  • HTML Unordered List
  • HTML other lists
  • HTML Block and Inline Elements
  • HTML class Attribute
  • HTML id Attribute
  • HTML Iframes
  • HTML JavaScript
  • HTML File Paths
  • HTML – The Head Element
  • HTML Layout Elements and Techniques
  • HTML Responsive Web Design
  • HTML Computer Code Elements
  • HTML Semantic Elements
  • HTML Style Guide
  • HTML Entities
  • HTML Symbols
  • HTML Emojis
  • HTML Encoding (Character Sets)
  • HTML Uniform Resource Locators(URL)
  • HTML Versus XHTML
  • HTML Forms
  • HTML Form Attributes
  • HTML Form Elements
  • HTML Form Target Attribute
  • HTML Input Attributes
  • HTML Input form Attributes
  • HTML Input Types
  • HTML Canvas Graphics
  • HTML SVG Graphics
  • HTML Multimedia
  • HTML Video
  • HTML Audio
  • HTML Plug-ins
  • HTML YouTube Videos
  • HTML Geolocation API
  • HTML Drag and Drop API
  • HTML Web Storage API
  • HTML Web Workers API
  • HTML SSE API
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms & Conditions

Copyright © 2023 Buzzingz.

Powered by PressBook WordPress theme