<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
.main{
background:#000;
width:300px;
height:400px;
margin:auto;
}
.up{
border:2px solid #C0F;
padding:5px;
background:#FFF;
margin-left:auto;
margin-right:auto;
margin-top:336px;
height:50px;
width:100px;
}</style>
</head>
<body><div class="main">
<div class="up">向下对齐</div>
</div>
</body>
如图,在DW中显示已经向下对齐,但在浏览器显示中却是
请高手帮忙看下是什么问题?求解答。
我知道父类采用了position后,子类中就可以利用left,right,top,这些来进行定位。
但是为什么不能用margin-top和margin-bottom来进行垂直方向的定位呢?