答案 0 :(得分:0)
您可以使用 Flexbox :
执行此操作
* {margin:0;padding:0;box-sizing:border-box}
html, body {width:100%}
.parent {
display: flex; /* displays the children inline */
}
.parent > .child {
height: 100px;
}
.parent > .child:nth-child(2) {
flex: 1; /* stretches to fill the remaining space */
overflow-x: scroll;
}
.parent > .child:nth-child(2) > div {
width: 2000px;
}
.parent > .child:first-child,
.parent > .child:nth-child(3) {
width: 40px;
background: Lavender;
}
<div class="parent">
<div class="child"></div>
<div class="child">
<div>...WIDE DIV INSIDE THE SECOND CHILD...</div>
</div>
<div class="child"></div>
</div>