2012-07-31 76 views
-1

我已經在這裏看到在沒有成功計算器幾個答案擴展,所以讓我發表我的鏈接在這裏:孩子DIV不與內容

http://www.copycopy.it/index.php?go=how

在此頁面,例如,白色的div(# body_content_container)應該隨內容一起擴展,但它不會。本頁同樣適用:http://www.copycopy.it/index.php?go=termsAndConditions

任何想法我在這裏做錯了嗎?我已經嘗試clear:both;對孩子divs,但沒有運氣。

+2

發佈您的代碼,請。 – 2012-07-31 16:02:33

+0

對不起,我沒有點擊來自未知網站的隨機鏈接。你能提供更多的細節,還是在http://jsfiddle.com上覆制問題? – freefaller 2012-07-31 16:16:52

+0

如果你面臨的問題,請把代碼,然後只有其他人可以幫助你 – Prashobh 2012-07-31 16:48:52

回答

0

嘗試移除高度:100%;從你的元素。如果您希望它擴展到內容的長度,則不需要指定高度。此外,它只會擴展到窗口的長度。

+0

解決問題!謝謝Kwon! – 2012-08-01 06:26:56

0
  1. #content_text刪除height: 85%;
  2. position:absolute;position:relative;同時替換爲float:left;
  3. margin替換任何topleftpadding

例如:

#columnHeader { 
    float: left; 
    text-align: center; 
    width: 940px; 
} 

#column1 { 
    float: left; 
    margin: 0 10px 0 0; 
    text-align: justify; 
    width: 285px; 
} 

#column2 { 
    float: left; 
    margin: 0 0 0 40px; 
    text-align: justify; 
    width: 275px; 
} 

#column3 { 
    float: left; 
    margin: 0 0 0 10px; 
    text-align: justify; 
    width: 320px; 
}