2013-12-12 49 views
1

所以我的網頁不會滾動。我有一些揣測研究並試圖擺脫位置:固定,但似乎沒有幫助。有什麼建議麼?Html不滾動

這裏是CSS:

body { 
height: 2000px 
overflow: scroll; 
} 
#header { 
z-index: 1; 
position: relative; 
width: 97.5%; 
margin-top: 5px; 
height: 60px; 
background-color: #fffafa; 
margin-bottom: 10px; 
} 

#footer { 
clear: both; 
position: relative; 
width: 97.5%; 
margin-top: 5px; 
height: 30 px; 
background-color: #ffc873; 
margin-bottom: 5px; 
} 

.left { 
position: relative; 
margin-top: 70px; 
height: 300px; 
width: 20%; 
background-color: #689ad3; 
float: left; 
} 

.right { 
height: 200px; 
width: 20%; 
margin-top: 70px; 
height: 300px; 
background-color: #689ad3; 
float: right; 
} 

謝謝!

回答

0

因爲你的CSS代碼。

height: 2000px 

請立即清除它

+0

謝謝。其他人建議這是解決我的問題 - 嘗試沒有。仍然沒有快樂。 – user3036344

2

是的,你錯過了第一次申報後分號的body標籤:body { height: 2000px; overflow: scroll; }

+0

你說得對。不幸的是,這不是問題。 – user3036344

0

試試這個CSS:

body { 
height: 2000px; 
overflow-y: scroll; 
} 
#header { 
z-index: 1; 
position: relative; 
width: 97.5%; 
margin-top: 5px; 
height: 60px; 
background-color: #fffafa; 
margin-bottom: 10px; 
} 

#footer { 
clear: both; 
position: relative; 
width: 97.5%; 
margin-top: 5px; 
height: 30 px; 
background-color: #ffc873; 
margin-bottom: 5px; 
} 

.left { 
position: relative; 
margin-top: 70px; 
height: 300px; 
width: 20%; 
background-color: #689ad3; 
float: left; 
} 

.right { 
height: 200px; 
width: 20%; 
margin-top: 70px; 
height: 300px; 
background-color: #689ad3; 
float: right; 
} 
+0

謝謝 - 我有一個很好的與溢出喲。不幸的是,我仍然沒有滾動。 – user3036344

0

所以事實證明,這個問題畢竟不在CSS中。問題是我的django代碼沒有在正確的地方尋找CSS - 一旦我將代碼移動到正確的靜態位置,溢出-y解決方案就像一個魅力。