公司新版页面完成的差不多了,这两天都在测浏览器兼容问题,碰到几个小问题需要记录下。
1. :first-child 支持IE7+浏览器,:last:child就是css3的选择符了,要IE9+的浏览器才会支持。
2. IE7下input[type="submit"]下面会有黑色边框,只要设置border就会出现黑色边框,在网上查了一下,搜到两种解决办法。
(一) input {filter:chroma(color='#000000)'; }
原理我也不清楚。然后我试了下,我用的是IE11降到IE7来做的,发现不行,还是有问题。但是用IE9的朋友帮我测了下,降到IE7是没问题的。所以暂且记录下吧,这也是一种方法。
(二)用label模拟border
结构如下:
<div class="demo">
<label>
<input type="submit" value="提交" />
</label>
</div>
css如下:
.demo label{
display:inline-block;
border:1px solid #44ACD3;
}
.demo input{
width:80px;
height:28px;
background-color:#20C1E8;
border:1px solid #44ACD3;
color:#fff;
}
这样就可以很好的解决这个问题了。