我有一個非常簡單的html
網頁頁眉,內容和頁腳部分。由於某種原因,頁眉部分沒有定位到窗口頂部,我做錯了什麼,但我無法弄清楚在哪裏。我可能會進一步弄亂試圖修復它的代碼。正文標籤不對齊到頂部位置
<div class="wrapper">
<div class="header-wrapper">
<div class="header">
<div class="archive-year"> ARCHIVE</div>
<div class="title">TITLE</div>
<div class="date">DATE</div>
</div>
</div>
<div class="content">
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
</div>
<div class="footer"><a href="http://www.website.net">FOOTER</a></div>
</div>
CSS
html {margin:0px; padding:0px; height: 100%;}
body, form {margin:0px; padding:0px;}
.wrapper{width:100%; margin:0px auto; height:100%; font-family:Arial, Helvetica, sans-serif;}
.header-wrapper{width:100%; background-color:#000; min-height:300px; margin:30px auto;}
.header{background-color:#000; background-color:red; width:800px; margin:10px auto;}
.archive-year{position:relative; width:100%; margin:30px 10px; font-size:20px color:#ccc;}
.title{position:relative; width:100%; margin:10px; font-size:20px color:#fff;}
.date{position:relative; width:100%; margin:10px 10px; font-size:20px color:#1aa0e0;}
.content{position:relative; width:100%; margin:30px 10px; font-size:12px color:#000;}
.footer{position:relative; width:100%; margin:30px 10px; font-size:12px color:#000;}
小提琴例如:http://jsfiddle.net/wfrquhpf/1/
它的所有利潤率。 [固定版本](http://jsfiddle.net/wfrquhpf/11/)'margin:10px 30px;' - '10px'是頂部/底部,'30px'是左/右。 – Ruddy 2014-09-24 07:38:44