【问题标题】:Flexbox: Chrome is fine, Firefox and Edge won't scroll all the way downFlexbox:Chrome 很好,Firefox 和 Edge 不会一直向下滚动
【发布时间】:2017-12-23 10:42:42
【问题描述】:

我有一个三列flexbox 布局,其中第一列是带有过滤器的项目列表,第二列是长文本正文,第三列是无限滚动列表。在 Chrome 中,左侧列表的行为与预期相同。它滚动到底部,并显示info 段落。然而,在 Firefox 和 Edge 中,列表不会滚动到底部:它会在页面底部截断。

这是标记:

<div class="container">
  <div class="left-sidebar">
    <div class="filter-wrap">...</div>
    <div class="list-wrap">
      <ul class="list">...</ul>
      <p class="info">...</p>
    </div>
  </div>
  <div class="main-content">...</div>
  <div class="right-sidebar">...</div>
</div>

以及左侧的 CSS:

.container {
  display: flex;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.left-sidebar {
  display: flex;
  flex-grow: 1;
  flex-basis: 0px;
  flex-direction: column;
  overflow-y: hidden;
}

.filter-wrap {
  position: relative;
  padding: 20px 20px 0 20px;
}

.list-wrap {
  font-size: 14px;
  flex-grow: 1;
  flex-basis: 0px;
  overflow-y: auto;
  padding: 15px 20px 15px 20px;
}

.list-wrap ul { word-break: break-all; }
.info {
  cursor: pointer;
  background: none;
}

【问题讨论】:

  • 您没有发布问题的工作示例,因此我无法验证这一点,但请尝试将 min-height: 0 添加到您的容器中。这应该使布局跨浏览器工作。

标签: html css firefox flexbox microsoft-edge


【解决方案1】:

看起来问题实际上是很多在链条的高处,高度不好,所以我什至没有找对地方。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-24
    • 2014-07-22
    • 2018-08-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多