2011-09-21 57 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

圣杯恪守它的名字 –