IE 8兼容小妙招~~

IE6/7下多种方法移除button、input 默认边框和去掉焦点线

button、input 默认边框和焦点线确实影响美观,下面为大家讲解下IE6/7下下如何去掉边框、焦点线,具体的实现如下,感兴趣的朋友可以参考下

一、去掉边框:
看看基本的HTML:

复制代码 代码如下:
<div class="wrap">
<input type="text" class="input_txt">
<input type="submit" value="submit" class="input_btn">
<input type="button" value="提交" class="input_btn">
<div>


通常解决这样的bug最好的方法就是在button和input的标签外添加一个标签,然后将样式写在这个标签上,并且把button和input的默认样式都去除掉。

实现方式一:设置CSS:

复制代码 代码如下:
<style type="text/css">
input{margin:0;padding:0;}
.wrap{background-color:#0f0;}
.input_txt,.input_btn{border:0 none;}
</style>


实现方式二:设置CSS,并使用滤镜:

复制代码 代码如下:
<!--[if IE]>
<style type="text/css">
input{margin:0;padding:0;filter:chroma(color=#000000);border:none; }
.wrap{background-color:#0f0;}
</style>
<![endif]-->


此种方式貌似会有点问题!待在真实IE7环境中验证。

二、去掉焦点线:

复制代码 代码如下:
<style type="text/css">
a:focus, *:focus {noFocusLine: expression(this.onFocus=this.blur());}
</style>
想要这样一间小木屋,夏天挫冰吃瓜,冬天围炉取暖.
原文地址:https://www.cnblogs.com/lianer88/p/10022329.html