当前位置: 移动技术网 > IT编程>网页制作>CSS > IE Bug--浮动对象外补丁的双倍距离的解决方法

IE Bug--浮动对象外补丁的双倍距离的解决方法

2017年12月12日  | 移动技术网IT编程  | 我要评论
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中不至于产生双倍距离,,更详细资料,可看 。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网