2012-11-17 135 views
0

我有一個頁腳內容重疊在我的CSS和HTML包裝div,當我改變高度自動它沒有工作。下面的 是我正在處理的頁面的一個示例。頁腳內容重疊包裝div

包裝CSS

#wrapper { 
width: 1030px; 
height: 600px; 
margin: 20px auto auto auto; 
padding: 0; 
background: url(wrapper.png); 
} 

頁腳CSS

.footer{ 
width: 1000px; 
padding: 60px 0 0 30px; 
height: auto; 
float: right; 
clear: both; 
background: url(footer_bg.gif) no-repeat top right; 
text-align: center; 

} 

Example

+0

這個問題與你問的最後一個問題有什麼不同?http://stackoverflow.com/questions/13432241/content-overlapping-div? – j08691

+0

請比較兩個問題.. –

回答

2

你需要清除漂浮在.content_left和content_right列,並刪除與之相關聯的高度你的#wrapper:

http://jsfiddle.net/L6acE/3/

清除浮點數有幾種不同的方法。我用的只是增加兩列後<div style="clear:both;">一個真正簡單的方法就如這裏討論:

http://css-tricks.com/the-how-and-why-of-clearing-floats/

但我一般會用在這裏討論一個clearfix方法:

http://nicolasgallagher.com/micro-clearfix-hack/

我還添加了一些用於左欄的word-wrap:break-word CSS以包裹所有虛擬內容。