2014-06-10 85 views
-2

當我將header DIV代入低於position:fixed CSS值時,content DIV上升並與其重疊。我如何將我的內容DIV保留在標題下方?與「位置:固定」重疊的內容

這裏是我的代碼:

<div class="header" style="width:100%; height:50px; positon:fixed;" ></div>  
<div class="content" style="width:100%; height:800px;"></div>   
<div class="footer" style="width:100%; height:40px;"></div> 
+2

'的margin-top: 50px'應該可以工作 – potashin

回答

2

給的分度position:fixed財產top:0.content DIV margin-top:50px(在固定.header DIV的高度):

Example

+1

非常感謝Notulysses。 (頂部:0) – user3722938