img area coords as percentages |
img area coords as percentages |
alancunn |
Apr 30 2007, 07:43 AM
Post
#1
|
Group: Members Posts: 1 Joined: 30-April 07 Member No.: 2,673 |
Hi all,
I have been trying to get the well known client side image maps working. I would really like to use percentages (all the co-ordinates will be generated by PHP so the difficultly with values vs percentages doesn't exist!). However, I can not get percentages to work - browsers just appear to ignore the percentage sign. Am I missing something or is this another very useful item that browsers will just not bother with? The reason for using percentages is so that I can make the img 100% width of container and the image map still works - by the specifications this should be possible but I can't get it to work. Here's some code to show! CODE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>A test of image maps</title> </head> <body> <img src="test.bmp" usemap="#mymap" height="400" width="200" alt="test image"/> <map name="mymap" id="mymap"> <area shape="rect" coords="0,0, 50%, 50%" href="http://www.htmlhelp.com" alt="A nice link"/> </map> </body> </html> test.bmp is any image, and the top left quarter of the image should be a link to this site (just for demonstration purposes ) Thanks in advance, Alan |
Tom H. |
May 1 2007, 03:28 PM
Post
#2
|
Advanced Member Group: Members Posts: 129 Joined: 24-August 06 Member No.: 14 |
It seems to work as expected in Safari but no other browsers which I've tried.
|
Lo-Fi Version | Time is now: 26th April 2024 - 09:11 AM |