问题描述:

Is there anyway to remove the outline when you select an area on an image map? See:

I'm using Chrome on Snow Leopard.

网友答案:

It seems like all you got to do to remove these borders lies on the img tag, by setting the hidefocus attribute and the outline css property on it like this:

HTML

<img class="map" src="..." usemap="..." hidefocus="true" />

CSS

img.map, map area{
    outline: none;
}

This should work cross-browser!

EDIT

Like Sergey K commented, if you're not looking to support IE6 you can save bytes by just using an attribute selector.

img[usemap], map area{
    outline: none;
}

Support starts with IE7.

网友答案:

I was having this same issue with both chrome and safari and found success by assigning a class .map to each area tag and giving the class the following style:

.map {
outline: 0;
}
网友答案:

Give your imagemap an id of "Map" then use the following CSS declaration:

#Map area {
    outline: none;
}
网友答案:

Kinda old-fashioned, but does this work:

    <area onfocus="blur();" ... 

?

GTX, CS

网友答案:

Use CSS. Set style="outline:none;" on the element, or preferably, put it in a style sheet.

网友答案:

So if you have an archaic webpage without css (I know awful!) you can fix it by inserting style="outline:none" after the coords and before the href within the area tag- absolute perfection!

网友答案:

Tried outline:0 on its css rule ?

相关阅读:
Top