【发布时间】:2016-04-27 06:25:03
【问题描述】:
我在让 div 水平滚动时遇到问题。 div 具有动态数量的列,可以超过页面的 100% 宽度。目前,我将总宽度设置为固定的 px 宽度(1500px)以获得水平滚动。但是,由于列数是动态的,因此 div 应该增长以适应新列,而不是将新列隐藏在 div 下方。
这是我的页面的一个小提琴被剥离: https://jsfiddle.net/razzledazzle/jpj2cuo7/5/ 您可以看到可见列中的最后一个输入是“最后一个可见”。输入的下一列是“新看板列表不可见”。
如何将 div#board-container 的宽度更改为 100% 而不是 1500px 并且仍然水平滚动?它的布局与 Trello 或 MeisterTask 非常相似。
div#main-kanban {
top: 49px;
position: absolute;
bottom: 0;
right: 0;
left: 0;
bottom: 52px;
}
div#content-kanban {
position: absolute;
left: 0;
right: 0px;
overflow: hidden;
height: 100%;
overflow-x: auto;
background: #e3e3e3;
}
div#board-container {
width: 1500px;
top: 49px;
position: absolute;
height: 100%;
overflow: hidden;
}
section#kanban-board {
top: 0;
bottom: 0;
right: 0;
left: 0;
position: absolute;
margin-bottom: 49px;
}
div.kanban-individual {
display: inline-block;
vertical-align: top;
width: 320px;
overflow-y: scroll;
height: 100%;
float: left;
background-color: #e3e3e3;
cursor: pointer;
-webkit-transition: background 0.3s linear;
-moz-transition: background 0.3s linear;
-o-transition: background 0.3s linear;
-ms-transition: background 0.3s linear;
transition: background 0.3s linear;
}
【问题讨论】:
-
我所追求的布局示例是:meistertask.com
标签: css html multiple-columns horizontal-scrolling