使用CSS運算式去除超連結的虛框的一些方法

來源:互聯網
上載者:User

標籤:style   io   ar   os   使用   sp   java   for   檔案   

去除超連結的虛框的一些方法 

1. a{ 


blr:expression(this.onFocus=this.blur());/*IE使用*/ 
outline-style:none;/*FF使用*/ 
} /*去除a標籤帶來的虛框*/ 
2、全 局控制  CSS實現 
a{blr:expression(this.onFocus=this.close());} /* 只支援IE,過多使用效率低 */   
a{blr:expression(this.onFocus=this.blur());} /* 只支援IE,過多使用效率低 */   
a:focus { -moz-outline-style: none; } /* 支援Firefox   IE不支援 */ 

方法一: 
<a onfocus=this.blur() href="javascript:void(0)" class="l-button" style="width:80px" onclick=‘log_1()‘> 
<img id="img_a" border=0 align="middle" src="login_image/a_1.jpg" alt="沒有圖片!"> </img> 
</a> 
onfocus=this.blur()  增加這個,可以去掉! 

方法二: 
1.把以下代碼存成一個1.htc的檔案
<public:attach event="onfocus" onevent="quit()" /> 

<script language="javascript"> 
function quit(){ 
this.blur(); 
} 
</script> 
2.在你的html檔案head中加入以下代碼,這樣所有的串連都沒虛線了
<style> 

a {behavior:url(1.htc)} 
area {behavior:url(1.htc)} 
</style> 

總結方法:
去掉連結時的虛框只要在你的樣式表中加入以下代碼,就可以去掉連結時煩的的虛框   
a,area { blr:expression(this.onFocus=this.blur()) } /* for IE */
:focus { -moz-outline-style: none; } /* for Firefox */   

使用CSS運算式去除超連結的虛框的一些方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.