在IE6,7下,子元素有相對定位的話,父級的overflow包不住子元素


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>無標題文檔</title>
<style>
.box{ width:200px;height:200px;border:1px solid #000; overflow:auto; position:relative;}
.div{ width:150px;height:300px;background:yellow; position:relative;}
/*
在IE6,7下,子元素有相對定位的話,父級的overflow包不住子元素

解決辦法: 給父級也加相對定位
*/
</style>
</head>
<body>
<div class="box">
<div class="div"></div>
</div>
</body>
</html>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章