IE6 7 父级元素的overflow:hidden 是包不住子级的relative

 1 <!DOCTYPE html>
 2 <html>
 3     <head>
 4         <meta charset="utf-8">
 5         <title></title>
 6         <style>
 7             .box{
 8                 width: 200px;
 9                 height: 200px;
10                 background-color: red;
11                 border: 10px solid black;
12                 overflow: hidden;
13                 *position: relative;
14             }
15             .content{
16                 width: 400px;
17                 height: 400px;
18                 background-color: blue;
19                 position: relative;
20             }
21         </style>
22         <!--
23             解决方案:
24                 针对ie6、7给父级元素添加相对定位
25         -->
26     </head>
27     <body>
28         <div class="box">
29             <div class="content"></div>
30         </div>
31     </body>
32 </html>

 

posted on 2016-03-02 18:25  hduhdc  阅读(167)  评论(0编辑  收藏  举报