Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6887005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:49:52+00:00 2026-05-27T05:49:52+00:00

I have an image on a web page that also requires links. I am

  • 0

I have an image on a web page that also requires links. I am using an image map to create the links and I am wondering if there is a way to style the area shape on mouseover for a minor touch of interactivity. Is this possible?

I tried this without success:

html

<img src="{main_photo}" alt="locations map"  usemap="#location-map" />
<map name="location-map">
    <area shape="rect" coords="208,230,290,245" href="{site_url}locations/grand_bay_al" />
    <area shape="rect" coords="307,214,364,226" href="{site_url}locations/mobile_al" />
    <area shape="rect" coords="317,276,375,290" href="{site_url}locations/loxley_al" />
</map>

css

area { border: 1px solid #d5d5d5; }

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:49:52+00:00Added an answer on May 27, 2026 at 5:49 am

    CSS Only:

    Thinking about it on my way to the supermarket, you could of course also skip the entire image map idea, and make use of :hover on the elements on top of the image (changed the divs to a-blocks). Which makes things hell of a lot simpler, no jQuery needed…

    Short explanation:

    • Image is in the bottom
    • 2 x a with display:block and absolute positioning + opacity:0
    • Set opacity to 0.2 on hover

    Example:

    .area {
        background:#fff;
        display:block;
        height:475px;
        opacity:0;
        position:absolute;
        width:320px;
    }
    #area2 {
        left:320px;
    }
    #area1:hover, #area2:hover {
        opacity:0.2;
    }
    <a id="area1" class="area" href="#"></a>
    <a id="area2" class="area" href="#"></a>
    <img src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Saimiri_sciureus-1_Luc_Viatour.jpg/640px-Saimiri_sciureus-1_Luc_Viatour.jpg" width="640" height="475" />

    Original Answer using jQuery

    I just created something similar with jQuery, I don’t think it can be done with CSS only.

    Short explanation:

    • Image is in the bottom
    • Divs with rollover (image or color) with absolute positioning + display:none
    • Transparent gif with the actual #map is on top (absolute position) (to prevent call to mouseout when the rollovers appear)
    • jQuery is used to show/hide the divs
    $(document).ready(function() {
      if ($('#location-map')) {
        $('#location-map area').each(function() {
          var id = $(this).attr('id');
          $(this).mouseover(function() {
            $('#overlay' + id).show();
    
          });
    
          $(this).mouseout(function() {
            var id = $(this).attr('id');
            $('#overlay' + id).hide();
          });
    
        });
      }
    });
    body,
    html {
      margin: 0;
    }
    
    #emptygif {
      position: absolute;
      z-index: 200;
    }
    
    #overlayr1 {
      position: absolute;
      background: #fff;
      opacity: 0.2;
      width: 300px;
      height: 160px;
      z-index: 100;
      display: none;
    }
    
    #overlayr2 {
      position: absolute;
      background: #fff;
      opacity: 0.2;
      width: 300px;
      height: 160px;
      top: 160px;
      z-index: 100;
      display: none;
    }
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <img src="http://www.tfo.be/jobs/axa/premiumplus/img/empty.gif" width="300" height="350" border="0" usemap="#location-map" id="emptygif" />
    <div id="overlayr1">&nbsp;</div>
    <div id="overlayr2">&nbsp;</div>
    <img src="http://2.bp.blogspot.com/_nP6ESfPiKIw/SlOGugKqaoI/AAAAAAAAACs/6jnPl85TYDg/s1600-R/monkey300.jpg" width="300" height="350" border="0" />
    <map name="location-map" id="location-map">
      <area shape="rect" coords="0,0,300,160" href="#" id="r1" />
      <area shape="rect" coords="0,161,300,350" href="#" id="r2"/>
    </map>

    Hope it helps..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an image on my web page like this: <img src=/Images/content/home.png alt= style=float:
I am using a webview and on that web view i have a image.
I have a web page with a jpg image that the user draw an
I have a web page where I want to switch the background image of
I have a web page, used for admin purposes, which runs a task (image
I have a problem with layout iPhone web page , My background image does
I have implemented the image upload code using jquery php in my php web
I have a URLConnection, that access a web page. URL url = new URL(https://domain);
On my web page I plan to have a header containing links to different
I want to show a background image for my web page and I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.