您的位置:首页 > 其它

IE6下绝对定位元素存在1px偏差问题

2017-02-17 10:32 399 查看
小知识:IE6下面绝对定位元素父级的宽高是奇数,绝对定位元素 设置 right:0;bottom:0; 在IE6中会有1px的偏差。

解决方案: 避免父级宽高出现奇数。

代码:

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


效果图:





新手上路,欢迎反驳!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐