自己可以测试下,然后分析下自己的东西为什么,和这边关系对照下!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>测试</title>
<style type="text/css">
#left {
width: 200px;
height:400px;
float: left;
background:#999;
margin-right:10px;
}
#right {
background: blue;
width: 400px;
height: 400px;
float: left;
}
#box1 {
position: relative;
}
#box2 {
background: orange;
width: 300px;
height: 300px;
}
.myli {
position: relative;
}
#mybox {
z-index: 9999;
position: absolute;
width: 200px;
height: 200px;
margin-left: 30px;
background: red;
}
</style>
</head>
<body>
<div id="left">
<ul>
<li class="myli">列表</li><span id="mybox"></span>
</ul>
</div>
<div id="right">
<div id="box1">
<div id="box2">
</div>
</div>
</div>
</body>
</html>