The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> img area coords as percentages
post 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!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
        <title>A test of image maps</title>
        <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="" alt="A nice link"/>

test.bmp is any image, and the top left quarter of the image should be a link to this site (just for demonstration purposes wink.gif )

Thanks in advance,

Alan unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


- Lo-Fi Version Time is now: 20th June 2018 - 06:14 AM