16

I have this image map

http://corfro.com/projects/charlie-faye-tour-map/

And when you click on the different cities a black border shows up on the area but only happening in Chrome. (you might need to click a few times on different cities but the border will show up - once the bus arrives at the city the borders start showing up)

I've tried the following but to no avail.

a{outline:none;}
map > area,
map > area:active,
map > area:focus {outline: none; border:0; }

Do you guys have any suggestions? Any help is much appreciated as this is driving me crazy!

Corfro
  • 161
  • 1
  • 1
  • 4
  • Have you tried the WebKit version: `-webkit-outline: none`? – Evan Mulawski Dec 04 '10 at 03:58
  • I clicked on the cities about 20 times but could not reproduce the issue... – bobsoap Dec 04 '10 at 04:07
  • I also don't see any borders when I view this in chrome. – jeremysawesome Dec 04 '10 at 05:06
  • Maybe it's chrome for OS X only - I don't have a windows box to test out chrome on. Tried the webkit-outline but not fixing the issue. I've also had friends test this out to make sure it just wasn't me and they see the same thing. Seems to only start happening when the bus gets to the first location you click and it reveals a border around the city then any city clicked after has a border on click. – Corfro Dec 04 '10 at 16:04
  • I am on Chrome OS X (v. 8.0.552.215) and I don't see the outline either. – rcravens Dec 04 '10 at 21:57
  • Chrome OS X 9.0.597.16 (latest dev channel release) doesn't show any outlines either… [Edit: Just kidding. After clicking around a bit, I got the border to show up.] – Andrew Dec 10 '10 at 20:10

12 Answers12

28

Old trick <area onfocus="blur(); (...) />" Good luck;

boru
  • 281
  • 3
  • 3
  • This worked for me too. Looks like a known Chrome/Webkit bug http://code.google.com/p/chromium/issues/detail?id=68487 – Mark Biek May 19 '11 at 17:49
  • 2
    `$("area").focus(function() { $(this).blur(); });` in case you use jQuery and want it a bit better written; the border thing is still there in IE8/7 and this fixed it for me. – Mahn Jan 28 '13 at 00:44
  • This worked for Safari, but then FF had a dotted outline. Removing the javascript and adding a tabindex="-1" to each solved for both! – fastasleep Apr 19 '14 at 00:51
9

I had a similar problem on IE9 and this worked:

#MyImageMap, #MyImage {
    outline: none;
}

Original source of the idea: "One note about image maps is that you'll want to disable the border on the img, map, and area tags using CSS." http://forums.macrumors.com/showthread.php?t=1342928

(the area is a child of the map)

Curtis Yallop
  • 6,696
  • 3
  • 46
  • 36
4

In the <IMG> tag add

hidefocus="true"

roy.d
  • 1,030
  • 2
  • 16
  • 33
2

This fixes it on IE

img {
  outline:none;
}
Kjuly
  • 34,476
  • 22
  • 104
  • 118
jez
  • 21
  • 1
2

Using jquery based on @boru solution:

    $("area").focus(function(){
        $(this).blur();
    })
John Prado
  • 804
  • 8
  • 19
2

Try this, it worked for me ;)

a{
   outline:none !important;
   border: none !important;
}
1

Have you tried adding the attribute "border: none !important" ?

TWLATL
  • 2,859
  • 4
  • 25
  • 37
1

just found a fix to get rid of that border in firefox 4 as the .blur does not seem to fix it.

#someWrappingElement *:active { overflow-x:hidden }

if you don't get specific to the div or element it's in it can reek havoc with your page and cause things clicked on to disappear while the mouse is held down. Use in conjuction with .blur() to fix for firefox and chrome.

1
  1. Go to sharePoint Designer and locate your page/image
  2. Highlight the image that has the randomized border
  3. Find the following tags in the code:

    <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor"> </Content>

  4. Between them Add:

    style="border:none"

*may have to add them after the following: alt="" style="margin: 5px"

musefan
  • 47,875
  • 21
  • 135
  • 185
adam
  • 19
  • 1
0

I'm experiencing exactly the same thing with Chrome on OS X (v 8.0.552.224). I just restarted Chrome and got an automatic upgrade on my Mac for this to start appearing, so must be something in the new release.

I have noted though that the colour of the outline can be changed by altering the "outline-color" attribute of the image, but have been unable to hide it completely even though "outline" is set to "none".

0

I just faced a similar problem. I couldn't get rid of the outline but was able to effectively hide it by setting the color property of the div to the background color. But I had areas of flat color. If I set color to transparent it came out black. That should be the right track to figure out a fix, though. I used it on a US map seen here: map

0

A really old question, but I found another solution that might help others.

I'm using the React package react-google-maps to show my Google Maps instance and markers and used the following CSS to overwrite the user agent styles to fix this problem.

:focus {
  outline: none !important;
}
Reggi
  • 402
  • 8
  • 21