<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>无标题文档</title> <style> .box{ width:300px; height:300px; border:1px solid #000; overflow:auto; position: relative; } .div{ width:200px; height:350px; background:orangered; position:relative; margin: auto; } </style> </head> <body> <div class="box"> <div class="div"> <br/> 在IE6,7,8下,子元素有相对定位的话, <br/> <br/> <br/> <br/> 父级的overflow包不住子元素 <br/> <br/> <br/> <br/> <br/> <br/> <br/> 解决办法: 给父级也加相对定位 <br/> </div> </div> </body> </html>
原文:http://www.cnblogs.com/feiganjue/p/5041674.html