【发布时间】:2011-11-14 11:38:36
【问题描述】:
给定两个 div,它们代表嵌入在更大 div 中的列。如果 "!stuff" html 代表了许多超过容器高度的数据行,我该如何设置它使两个 col div 溢出并从 "container" 共享一个滚动条?
。容器 { 高度:100%; 宽度:100%; 溢出-x:隐藏; 溢出-y:滚动; 位置:相对; 底部填充:30px; } .col1 { 高度:100%; 宽度:50%; 溢出-x:隐藏; 溢出-y:可见; 位置:相对; 向左飘浮; } .col2 { 高度:100%; 宽度:50%; 溢出-x:隐藏; 溢出-y:可见; 位置:相对; 浮动:对; }<div class="container">
<div class="col1">
!Stuff<br/>
</div>
<div class="col2">
!Stuff
</div>
</div>
【问题讨论】: