您的位置:首页 > 其它

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

2013-08-15 00:13 239 查看
一、去掉边框:

看看基本的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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: