Since the original question was to put information beside the map and not changing the appearance of the map itself
and since I do not agree with everything being said here,
I anticipate the publication of my researches about image maps in parts.
To do the desired effect with an image map
<code>
<html>
<head>
<title>Image Map Test</title>
<style type=âtext/cssâ>
img {border: none;}
map {position: relative; display: block;} /* block to make it work in webkit browsers*/
area {display: block; cursor: crosshair;} /* to make it work in webkit browsers*/
.doit {position: absolute; top: -126px; left: 160px; display: none;}
area:hover + div {display: block;}
</style>
</head>
<body>
<p>Image map test with css hover function: </p>
<img src=âhttp://www.w3schools.com/tags/planets.gifâ width=â146â height=â126â alt=ââ title=ââ usemap=â#planetmapâ />
<map name=âplanetmapâ>
<area shape=ârectâ coords=â0,0,82,130â alt=ââ title=ââ nohref=ânohrefâ />
<div class=âdoitâ>
<img src=âhttp://www.w3schools.com/images/sun.gifâ alt=ââ />
</div>
<area shape=âcircleâ coords=â90,58,3â alt=ââ title=ââ nohref=ânohrefâ />
<div class=âdoitâ>
<img src=âhttp://www.w3schools.com/tags/merglobe.gifâ alt=ââ />
</div>
<area shape=âcircleâ coords=â124,58,8â alt=ââ title=ââ nohref=ânohrefâ />
<div class=âdoitâ>
<img src=âhttp://www.w3schools.com/images/venglobe.gifâ alt=ââ />
</div>
</map>
<div><p>Hallo Sonne</p></div>
</body>
</html>
</code>
It works in Gecko, in Webkit, in Presto,
meaning Firefox, Chrome and Safari, Opera (all latest releases)
but not in Trident / IE, (I only tried IE7).
You can do some more fancy stuff with it but important is:
You can use any shape, also polygone ones (which I find really nice to do nice stuff) and you can put any HTML in the boxes displaying beside the map,
the boxes, btw., being free in their positioning.
The code seems to be simple and it indeed is (another advantage of this approach) but it took quite a long time to figure it all out and test it in different browsers.
Explanation:
One can look upon the fact that this works in different ways.
The map and area tags normally donât take space on a HTML/XHTML page, they just describe the before posted image but they are still there and they are elements of the DOM.
The fact that âmapâ doesnât only accept âareaâ as a child element but actually any block element seems to be not widely known (I didnât find any approaches like mine on the internet).
All browsers who support the adjacent sibbling selector being the â+â should be able to do what my code does. Unfortunately at least IE7 doesnât, even though it supports the adjacent selector. (I didnât try IE8 and I actually donât care for IE6 anymore).
May be someone comes up with an idea in terms of IE7 ?
But I have to say that I tried everything you can imagine and with a kind of exclusion procedure I tried to find out on which properties and attributes area reacts anyway.
It turned out that IE doesnât accept any property being assigned to area except âborderâ, weird enoughâŚ
There is a lot more to say about this research but would be out of the scope of this thread and this forum in general.
Conclusion:
If one can afford to ignore IE7, my solution should be a consistent and nice one (may be with a small Javascript workaround for IE).
Thanks for reading my âoutpouringsâ ⌠
Cheers,
noRiddle