【问题标题】:Adding vertical child divs inside a parent div (both fixed width) with dynamic horizontal scrollbar at parent level在父 div 内添加垂直子 div(均为固定宽度),并在父级别使用动态水平滚动条
【发布时间】:2019-03-07 12:49:33
【问题描述】:

我正在尝试添加一个布局,其中父 div 具有固定宽度,其中包含子列(作为 div)。可以动态添加和删除固定宽度的子级,但是,如果有更多的子级不能容纳在固定宽度的父级 div 中,我希望显示一个水平滚动条。但我无法让它发挥作用。

JSFIDDLE:jsfiddle

.newFilterItemsBox {
    padding: 5px;
    width: 690px;
    height: 572px;
    border-color: rgba(0, 0, 0, 0.1);
    border-width: 2px;
    border-style: solid;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    flex-direction: column;
    display:flex;
    overflow:hidden;
    background-color: white;
}
.newFilterSelectionColumnContainer {
    width: 685px;
    position: relative;
    top: 25px;
    left:-4px;
    height: 500px;
    border-top-color: rgba(0, 0, 0, 0.1);
    border-top-width: 2px;
    border-top-style: solid;
    overflow-x: scroll;
    overflow-y: hidden;
}
.newFilterSelectionColumn {
    border-right: 1px solid lightgray;
    height: 508px;  
    width: 200px;
    float:left;
    overflow-y:auto;
    z-index:100000;
}

【问题讨论】:

    标签: css flexbox


    【解决方案1】:

    display: flex; 添加到.newFilterSelectionColumnContainer

    【讨论】:

      猜你喜欢
      • 2016-02-13
      • 1970-01-01
      • 1970-01-01
      • 2016-12-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多