首页 > 网站 > WEB开发 > 正文

IE Bug--浮动对象外补丁的双倍距离

2024-04-27 13:52:54
字体:
来源:转载
供稿:网友

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,演示。

解决的方法是,在box1的代码中加入:display: inline;,可使浮动被忽略,IE中不至于产生双倍距离,演示,更详细资料,可看这里。

原文:http://www.forest53.com/tutorials/tutorials_show.asp?id=31

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表