我有一個包含兩個浮動元素contentArea和側邊欄的包裝元素。 contentArea的內容最多,因此決定了包裝元素的高度。我想讓側邊欄觸摸包裝div的底邊。我怎麼做。這是一個基本的WordPress博客佈局。使子div與自動高度父div一樣高
HTML:
<div id="wrapper" class="clearfix">
<div id="content">
GROWS REALLY TALL AS HAS SO MUCH CONTENT
GROWS REALLY TALL AS HAS SO MUCH CONTENT
GROWS REALLY TALL AS HAS SO MUCH CONTENT
GROWS REALLY TALL AS HAS SO MUCH CONTENT
GROWS REALLY TALL AS HAS SO MUCH CONTENT
</div>
<div id="sidebar">
WANT'S TO BE AS TALL AS CONTENT.
height:100%; /* doesn't work */
</div>
</div>
CSS:
#wrapper{
height:auto;
width:100%;
}
#content{
height:auto;
width:625px;
}
#sidebar{
height:100%;
width:335px;
}
感謝所有幫助。
感謝
我不明白,邊欄是觸摸包裝的底部(至少在這個代碼中) – Trufa 2010-12-19 07:49:22