【发布时间】:2018-03-03 09:58:03
【问题描述】:
当使用 column-count: 2 时,如果有溢出,我希望出现一个垂直滚动条,但出现一个水平滚动条。如果没有列数,则会按预期显示垂直滚动条。如何使用 column-count: 2 并显示垂直滚动条?
.searchCriteriaPanel {
border-radius: 0 0 5px 5px;
width: 300px;
height: 200px;
background-color: lightgrey;
padding: 10px;
overflow-y: auto;
column-count: 2;
}
<div id="MarketContent" class="searchCriteriaPanel">
<label><input type="checkbox">one</label><br />
<label><input type="checkbox">two</label><br />
<label><input type="checkbox">three</label><br />
<label><input type="checkbox">four</label><br />
<label><input type="checkbox">five</label><br />
<label><input type="checkbox">six</label><br />
<label><input type="checkbox">seven</label><br />
<label><input type="checkbox">eight</label><br />
<label><input type="checkbox">nine</label><br />
<label><input type="checkbox">ten</label><br />
<label><input type="checkbox">eleven</label><br />
<label><input type="checkbox">twelve</label><br />
<label><input type="checkbox">thirteen</label><br />
<label><input type="checkbox">fourteen</label><br />
<label><input type="checkbox">fifteen</label><br />
<label><input type="checkbox">sixteen</label><br />
<label><input type="checkbox">seventeen</label><br />
<label><input type="checkbox">eighteen</label><br />
<label><input type="checkbox">nineteen</label><br />
<label><input type="checkbox">twenty</label><br />
<label><input type="checkbox">twentyone</label><br />
<label><input type="checkbox">twentytwo</label>
</div>
【问题讨论】:
标签: html css css-multicolumn-layout