首页 > 其他 > 详细

兼容性—IE6定位

时间:2017-05-14 19:22:32      阅读:342      评论:0      收藏:0      [点我收藏+]

父级元素宽高为奇数时,绝对定位的right和bottom会有1px的偏差

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .box{
            width: 401px;
            height: 401px;
            background: red;
            position: relative;
        }
        .content{
            width: 200px;
            height: 200px;
            background: blue;
            position: absolute;
            right: 0;
            bottom: 0;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="content"></div>
    </div>
</body>
</html>

IE6显示效果如下:

技术分享

解决方案:避免设置父级元素的宽高为奇数

兼容性—IE6定位

原文:http://www.cnblogs.com/halai/p/6853306.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!