将div的高度设置为动态尺寸,但将其同级的高度短一些

时间:2018-10-24 09:50:01

标签: html css

我想将.child2 div设置为与.child1相同的高度,并且溢出将被滚动。 第一个孩子是恐龙,我该如何设置第二个孩子的身高?

.child1 {
  height: auto;
}
.child2 {
  overflow-y: auto;
  height: ???
}

这是我的示例: https://jsfiddle.net/opc_suit/8wpLzyqk/10/

0 个答案:

没有答案