- 时间:2020-03-08 09:04 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:IE Bug--浮动对象外补丁的双倍距离的解决方法
The IE Doubled Float-Margin Bug IEBug--浮动对象外补丁的双倍距离
先看以下代码:
#box{
background: ThreedFace;
width: 500px;
height: 400px;
}
#box1{
float: left;
background: #F2F2F2;
width: 300px;
height: 200px;
margin-left: 50px;
}
Box在外面,Box1在里面,但在IE浏览器中Box1离左边的距离会是100px,而实际距离应是50px,演示。
[b]解决的方法是,[/b]在box1的代码中加入:display: inline;,可使浮动被忽略,IE中不至于产生双倍距离,[url=http://www.forest53.com/tutorials/test/float_margin.html]演示[/url],更详细资料,可看[url=http://www.positioniseverything.net/explorer/doubled-margin.html]这里[/url] 。