The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> img area coords as percentages
alancunn
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!

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 wink.gif )

Thanks in advance,

Alan unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Tom H.
post May 1 2007, 03:28 PM
Post #2


Advanced Member
****

Group: Members
Posts: 127
Joined: 24-August 06
Member No.: 14



It seems to work as expected in Safari but no other browsers which I've tried.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

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: 22nd December 2014 - 01:24 AM