∥″可乐〃∥

让我展望未来,网络是我不变的终结者!

« 死了都要改手机软件界面设计浅谈 »

去掉图片链接的有虚线框

方法一、

直接在链接处操作:

<a href="#" onFocus="if(this.blur)this.blur()"><img src="pic.jpg" width="214" height="142" border="0"></a>

方法二、

一劳永逸直接使用样式表:

/* 处理连接虚线开始 */
a {
blr:expression(this.onFocus=this.blur());
}
img {
blr:expression(this.onFocus=this.blur());
border: none;
}
area {
blr:expression(this.onFocus=this.blur());
}
/* 处理连接虚线结束 */

onfocus="this.blur()"
这条代码能消除链接时的虚线框,如果你的网页上有几个甚至上百个链接,就用htc来解决这问题。至于htc是什么,全称就是Html Components,由微软在IE5.0后开始提供的一种新的指令组合,它可以把某种特定功能的代码封装在一个组件之中,从而实现了代码的重复使用。作为一个组件,htc里包含了属性、方法、事件等等各种知识,在这里就不一一介绍了,具体内容各位可以参考微软的msdn主页。
  回到开始处,Onfocus=this.blur()在这里很显然,onfocus是一个事件,this.blur()则是被事件所触发的对象,既然这点明确了,代码就知道该怎么写了。
<public:attach event=”onfocus” onevent=”example()” />
<script language=”javascript”>
function example(){
this.blur();
}
</script>
将以上代码存为.htc为扩展名的文件,然后再编写一个普通的html网页
<html>
<head>
<style>
a {behavior:url(htc文件所在路径地址)}
</style>
<body>
<a href=”#”>链接1</a>
<a href=”#”>链接2</a>
<a href=”#”>链接3</a>
点链接试试,没有虚线框了吧
</body>
</html>

Comments.

◎ welcome to participate in the discussion

日历

Comments.

Previous.

ADMIN. | EMAIL. | ABOUT.

Powered By Z-Blog 1.8 Spirit Build 80722Copyright © 2006-2011 可乐Blog Kele520.Com All Rights Reserved.[皖ICP备 06001314号]