设置元素的left 会改变元素的大小是为什么?????
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
body{
margin: 0px;
padding: 0xp;
}
ul{
margin: 0px;
padding: 0px;
}
li{
margin: 0px;
padding: 0px;
list-style-type: none;
}
#nav{
border:1px solid orange;
width: 465px;
height: 52px;
margin: 50px auto 0 auto;
position: relative;
}
.nav_bg{
width: 85px;
height: 52px;
position: absolute;
background-color:red;
left:0px;
}
#nav ul li{
/*
float: left;
width: 85px;
height: 52px;
*/
}
.white{
border:1px solid black;
position: absolute;
color:orange;
left:0px;
}
</style>
</head>
<body>
<div id="nav">
<div class="nav_bg" >
<ul class="white" >
<li>首页</li>
<li>博文列表</li>
<li>精彩相册</li>
<li>动感音乐</li>
<li>关于我</li>
</ul>
</div>
</div>
</body>
当改变 .white 的
.white{
border:1px solid black;
position: absolute;
color:orange;
left:0px;//改为 100px或-100px 元素表现的效果不一样
}