用于显示的独立滚动:table-cell divs

时间:2018-01-13 20:20:18

标签: html css

鉴于这3列布局,



.wrapper {
  display: table;
  width: 100%;
}

.wrapper>div {
  display: table-cell;
}

<div class="wrapper">
  <div class="left">uno</div>
  <div class="center">dos</div>
  <div class="right">tres</div>
</div>
&#13;
&#13;
&#13;

如何使这3列(显示:table-cell)彼此独立滚动。

1 个答案:

答案 0 :(得分:1)

这将使每个div可以单独滚动

&#13;
&#13;
    .wrapper {
      display: table;
      width: 100%;
    }

    .wrapper>div {
      display: table-cell;
    }

.left, .center, .right {
overflow-y: scroll;
}
&#13;
    <div class="wrapper">
      <div class="left">uno</div>
      <div class="center">dos</div>
      <div class="right">tres</div>
    </div>
&#13;
&#13;
&#13;