我正在使用带有圆形区域的图像贴图。问题是我在 IE7 中的区域周围出现了不需要的边框。此边框不会出现在 FF 和 Chrome 中,也不会出现在 IE8/IE9 中。
我尝试向图像添加 border="0",锚点的 css 属性,即
a{
border:none !important;
outline:none !important;
}
但没有用。
我还尝试添加 IE 修复 onfocus="blur();"在标签中。这解决了 IE 中的问题,但现在 FF 出现了边框。
搜索了很多,找到了这个修复程序,它说它将修复使用 IE 修复程序时 FF 的问题。
#parent_div *:active, #parent_div *:focus { overflow-x:hidden; outline:none; }
但遗憾的是,这也不起作用。我用的是FF 9.0.1。
任何帮助将不胜感激。提前致谢。
img{border:none;}
这是 ie 版本的修复
<!--[if lte IE 6]>
<script type="text/javascript">
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version >= 5.5) && (document.body.filters))
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
}
window.attachEvent("onload", correctPNG);
</script>
<![endif]-->
试试这个希望有帮助!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)