我覺得這一定是我做一些愚蠢的事情的問題,但我無法弄清楚。 Here's a demo page showing my problem.頁面的源:調整容器div內div的邊緣頂部將內部div和容器div從主體推下
<html>
<head>
<title>demo</title>
<style type='text/css'>
body{
margin: 0px;
padding: 0px;
}
#container{
height: 100%;
background-color: black;
}
#logo{
margin: 25px auto auto auto;
width: 360px;
height: 45px;
background-color: goldenrod;
}
</style>
</head>
<body>
<div id='container'>
<div id='logo'>
<p>logotext.</p>
</div>
</div>
</body>
</html>
所以你越是調整保證金的頂值,則進一步下跌的頁面都#logo和#container的拖累獲得。 #container應該保持放置,#logo應該向下移動頁面。
這裏是測試提琴。在#logo上調整25px的邊距,並注意黑條的下移方式。 http://jsfiddle.net/bzVgV/1/ – mrtsherman 2011-12-16 04:19:28