2011-09-21 56 views
0

我剛纔問了一個類似的問題,我們回到了最接近的CSS解決方案,但它不是雪茄。所以,如果可以的話,請幫忙!也許一個絕對的div嵌套的div?

我需要兩個div #post_content和#sidebar來匹配高度。我正在嘗試爲此找到一個CSS解決方法。

定位它絕對完成這項工作,但是當帖子內容短於側邊欄的內容時,某些內容會被截斷。 是否有CSS解決方案(可能在#sidebar內添加另一個div),這將允許我絕對定位#sidebar,同時始終顯示其所有內容?

注:這一點很重要#側邊欄的背景和邊框延伸相同的高度#post_content

注:#sidebar和#post_content被包裹在#container的

示例頁面的邊欄內容被切斷(#post_content比#sidebar短):http://themeforward.com/demo2/2011/07/08/link/

有關CSS:

#sidebar { 
    float: right; 
    width: 410px; 
    overflow:hidden; 
    position:absolute; 
    clear:both; 
    border-left:1px solid #000; 
    background:#AAA; 
    top:0; 
    right:0; 
    bottom:0 
} 
#post_content { 
    clear: both; 
    display: block; 
    float: left; 
    position:relative; 
    overflow: hidden; 
    width: 660px 
} 

沒有必要...但是也可以使用

#container { 
    width: 1126px; 
    clear: both; 
    overflow:hidden; 
    position:relative; 
    margin:35px auto 
} 

回答

0

這是CSS聖盃 - 這裏的文章: http://www.alistapart.com/articles/holygrail/

+0

感謝您的答覆......我不得不作出一個運行的一對夫婦幾小時,但我會讓你知道,如果它的工作儘快! – siouxfan45

+0

謝謝!哈利路亞!最終3天后的解決方案! – siouxfan45

+0

聖盃恪守它的名字 –