小知识: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>
效果图:
新手上路,欢迎反驳!