Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Image Map Coordinates for different browsers...

    How do I created an image map that will work on all browsers?

    This code (within define_main_page) works only with Firefox. It does not work with IE and Chrome, since they shrink the image relative to Firefox and therefore the map coordinates are no longer valid.

    Is there a way to make the coordinates relative to the size of the image?

    Code:
    <style type="text/css">
    div.home
    img {
    width:66em;
    }
    </style>
    
    <div class="home">
    <img border="0" usemap="#Map" src="images/home.jpg" /> 
    <map name="Map"> 
      <area href="Link 1" coords="0,13,275,188" shape="rect" />
      <area href="Link 2" coords="310,12,530,187" shape="rect" />
      <area href="Link 3" coords="560,12,700,187" shape="rect" />
      <area href="Link 4" coords="715,12,860,187" shape="rect" />
    </map>
    </div>
    Thank you!

  2. #2
    Join Date
    Nov 2007
    Location
    Melbourne, Australia
    Posts
    541
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    Define the width and the height of your image and it wont be shrunk by other browsers.

    Code:
    <style type="text/css">
    div.home
    img {
    width:66em;
    }
    </style>
    
    <div class="home">
    <img border="0" width="200px" height="200px" usemap="#Map" src="images/home.jpg" /> 
    <map name="Map"> 
      <area href="Link 1" coords="0,13,275,188" shape="rect" />
      <area href="Link 2" coords="310,12,530,187" shape="rect" />
      <area href="Link 3" coords="560,12,700,187" shape="rect" />
      <area href="Link 4" coords="715,12,860,187" shape="rect" />
    </map>
    </div>

  3. #3
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    Genius!

    Thanks Tino!

  4. #4
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    Well, somehow that still does not work.

    I mapped the coordinates on the original image.

    Here is the site:
    http://www.saleyla.com

    I did not include height because it stretches the image vertically.

    Ideas?

    Thank you.

  5. #5
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    Unless there is a solution with the current html code, maybe I should do the maps in CSS, using em for coordinates?

  6. #6
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    I did the maps in CSS with em coordinates and they appear consistent on all browsers, however somehow I cannot get the image to show up. I have a test page here:
    http://www.saleyla.com/store/index.p...age=page&id=27

    It must be something trivial that I cannot see.

    Ideas?

    Thank you.

 

 

Similar Threads

  1. Optimizing layout for different browsers
    By bodkin77 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 27 Jul 2013, 02:56 PM
  2. category specific css for different browsers
    By eVelt in forum Templates, Stylesheets, Page Layout
    Replies: 31
    Last Post: 18 Jul 2010, 09:51 PM
  3. Multiple stylesheets for different browsers!
    By Shotgun Front in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Apr 2008, 02:26 PM
  4. Switching templates for different browsers
    By Kent in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 11 Apr 2008, 09:49 PM
  5. EZ-Pages Background Image different in different browsers
    By rvagrrl in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 5 Aug 2006, 07:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg