0

why to put # before the name value in usemap attribute? like this:

    <img src="workplace.jpg" alt="Workplace" usemap="#workmap">
    <map name="workmap">
    </map>

i know i have to use the # before referencing and id in href attribute i dont know exactly why but i thought it's just the special sign of id

I'm still learning so can someone clear this for me please?

i tried using name without the # before it but it didn't work

caster
  • 1
  • 2
  • The `#` symbol is used to indicate that the value of the `usemap` attribute is the name of a `map` element rather than the URL of a server-side image map file. The `name` attribute of the `map` element specifies the name of the image map. – Anthony Tuccitto Dec 18 '22 at 21:37
  • @AnthonyTuccitto so i can make a separate image map file and link it to my html file using usemap attribute like (usemap=".map file name") right? and the # symbol is just an indication that this isnt a name of an external image map file but an existing image map within this html file, did i get it right? – caster Dec 18 '22 at 22:28
  • Yes, that's correct! You can create a separate image map file and link to it using the `usemap` attribute in your HTML file. – Anthony Tuccitto Dec 18 '22 at 22:44

0 Answers0