當浮動元素和絕對定位元素是並列關係的時候,在IE6下絕對定位元素會消失


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>當浮動元素和絕對定位元素是並列關係的時候,在IE6下絕對定位元素會消失</title>
<style>
.box{ width:200px;height:200px;border:1px solid #000; position:relative;}
span{width:50px;height:50px;background:yellow; position:absolute;right:-20px;top:0;}
ul{width:150px;height:150px;background:Red;margin:0 0 0 50px;padding:0; float:left; display:inline;}
/*
當浮動元素和絕對定位元素是並列關係的時候,在IE6下絕對定位元素會消失
解決辦法:
給定位元素外面包個div
*/
</style>
</head>
<body>
<div class="box">
<ul></ul>
    <span></span>
</div>
</body>
</html>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章