首页 > 其他 > 详细

IE6下绝对定位元素父级宽高是奇数,绝对定位元素的right和bottom值会有1个像素的偏差

时间:2016-03-02 19:52:13      阅读:124      评论:0      收藏:0      [点我收藏+]
 1 <!DOCTYPE html>
 2 <html>
 3     <head>
 4         <meta charset="utf-8">
 5         <title></title>
 6         <style>
 7             .box{
 8                 width: 308px;
 9                 height: 308px;
10                 background-color: red;
11                 position: absolute;
12             }
13             .content{
14                 width: 100px;
15                 height: 100px;
16                 background-color: blue;
17                 position: absolute;
18                 right: 0;
19                 bottom: 0;
20             }
21         </style>
22         <!--
23             解决方案:
24                 避免父级宽高出现奇数   <IE6否则会出出现一个像素的偏差也就是子集不会紧紧地贴着父亲>
25         -->
26     </head>
27     <body>
28         <div class="box">
29             <div class="content"></div>
30         </div>
31     </body>
32 </html>

 

IE6下绝对定位元素父级宽高是奇数,绝对定位元素的right和bottom值会有1个像素的偏差

原文:http://www.cnblogs.com/hduhdc/p/5236070.html

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