2012-09-19 37 views
0

我在我的css文件中有很多div。現在我在我的html頁面中顯示了適當的佈局,但是存在一個嚴重的問題,即:如果我在中心div中顯示信息,則只顯示其中的一部分,而其他信息由標題覆蓋。CSS在標題後面顯示信息?

這意味着center div不是在標題後面開始,而是在標題後面,因此數據顯示在標題後面。背後是他們兩人的代碼。

#header{ 
/*background-color: #3B5998;*/ 
background-image:-moz-linear-gradient(center bottom , #ebebeb, #999999); 
    background: #F6F6F6 -webkit-gradient(linear, 0% 0%, 0% 100%, from(#999999), to(#ebebeb)); 
height:60px; 
position:fixed; 
left:0; 
width:100%; 
} 



#center { 
margin-right:200px; 
background-color:white; 
min-height:700px; /* for modern browsers */ 
height:auto !important; /* for modern browsers */ 
height:700px; /* for IE5.x and IE6 */ 
color:black; 

} 

有沒有什麼東西在這裏會導致這個問題?一個圖像附加到這個帖子,顯示只有圖像顯示,而不是文本上方。如果我添加3
它顯示文本。 enter image description here

+0

「我在我的CSS文件的div很多。」 ......你知道嗎?你確定? –

回答

1

margin-top: 60px;添加到中心div。

#center { 
margin-right:200px; 
margin-top: 60px; 
background-color:white; 
min-height:700px; /* for modern browsers */ 
height:auto !important; /* for modern browsers */ 
height:700px; /* for IE5.x and IE6 */ 
color:black; 

} 

因爲你的頭是位置:fixed;它已經被排除在文檔流程之外,因此除非給出指示向下移動,否則任何元素都將出現在它的下面。

訣竅是讓margin-top與header元素的高度相同。

+0

這是我的朋友。欣賞支持,即使它是一個簡單的初學者問題:) –

+1

沒問題,如果你不知道這些東西可以是莫名其妙的:) – Kyle

0

儘量把float:left所有,如果u能得到作爲屏幕截圖這是更好地解決這個問題