开发者社区> 问答> 正文

火狐和IE中在area中添加onFocus="this.blur();不生效 - 服务报错

在area中如何去掉热点鼠标点击时出现的边框,解决兼容火狐、IE浏览器,onFocus="this.blur();只解决了chrome浏览器不显示边框,但在火狐、IE下仍出现虚线边框的情况。试过在<area>中添加hidefocus="true"无效

<table>   <tr>    <td><img name="Dec_jhs_r5_c1" src="images/r5_c1.jpg" width="700" height="533" border="0" id="r5_c1" usemap="#r5_c1" alt="" /></td>    <td><img src="images/spacer.gif" width="1" height="533" border="0" alt="" /></td>   </tr> </table> <map name="r5_c1" id="r5_c1"> <area  shape="poly" coords="1,0,700,0,701,142,555,142,490,250,315,249,317,301,0,301,1,0" href="#" target="_blank" alt="" onFocus="this.blur();" /> <area shape="poly" coords="1,301,302,309,306,533,2,531,1,301" href="#" target="_blank" alt="" onFocus="this.blur();"/> </map>

展开
收起
montos 2020-05-31 10:23:16 508 0
1 条回答
写回答
取消 提交回答
  • 先顶一个 希望各位高手的回复###### 有没有人回复一下呢?在线等 希望######

    可以用css试下

    img,a{
        outline:none; /*移除超链的虚线框 IE8,FF有用*/
        hide-focus: expression(this.hideFocus=true); /*IE6、IE7*/
    }



    ######回复 @Angelly : 你再加个area:focus{outline:none;}试试,应该outline 火狐是识别的。######非常感谢您 ,在您的赐教下已经能够兼容IE了 img{outline:none;}<!--能兼容IE--> 可是火狐仍然不生效,能否继续帮忙呢?######好的 谢谢 我马上尝试一下哈######

    因为涉及出现方框的代码中没有img或a的标签,我修改为area 但是执行的结果仍然有边框

    area{outline:none; /*移除超链的虚线框 IE8,FF有用*/

    hide-focus: expression(this.hideFocus=true); /*IE6、IE7*/

    }
    ######下面代码可以调试成功chrome和IE,但是狐火还是不行,烦请赐教:
    <html>
    <head>
    <title>Dec_jhs</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style>
    .bg{height:300px;width:800px;background-color:green;padding-top:70px;padding-left:15px;}
    img{
        outline:none; <!--移除超链的虚线框 IE9,IE8,IE6有用-->
    }
    </style>
    </head>
    <body bgcolor="#ffffff">
    <div class="bg">
    	<img name="Dec_jhs" src="images/Dec_jhs.jpg" width="700" height="57" border="0" id="Dec_jhs" usemap="#m_Dec_jhs" alt="" hidefocus="true" /><!--火狐中仍然不生效 hidefocus="true"-->
    	<map name="m_Dec_jhs" id="m_Dec_jhs">
    		<area shape="rect" coords="328,0,700,57" href="http://www.sina.com" target="_blank" alt="" onFocus="this.blur();"  /><!--移除超链的虚线框 chrome有用 onFocus="this.blur();-->
    		<area shape="rect" coords="0,0,328,57" href="http://www.baidu.com" target="_blank" alt="" onFocus="this.blur();"  /><!--移除超链的虚线框 chrome有用 onFocus="this.blur();-->
    	</map>
    </div>
    </body>
    </html>



    2020-05-31 10:23:27
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载