我想在不设置主div固定高度的情况下自动调整div内容的高度,但我不确定如何调整。我尝试了height:100%
和height: auto
这是我的代码:
.tmr_box {
height: 470px;
}
.tmr_inner {
position: fixed;
width: 100%;
max-height: 440px;
overflow-x: hidden;
white-space: nowrap;
height: auto;
overflow-y: auto;
max-width: calc(40% + 110px);
}
<form>
<div class="row" style="margin-top: 10px;">
<div class="col-md-6 tmr_box" ng-if="vm.tmr">
.....
</div>
<div class="col-md-6 tmr_box" ng-if="vm.tmr">
<table>
...
</table>
</div>
</div>
</form>
如果没有固定高度属性,它看起来是这样的。在此处输入图像描述提前感谢的帮助
我认为问题来自div内容的position:fixed
(.tmr_inner
(。正因为如此,父div在不太注意他的情况下进行渲染。您应该尝试删除此属性或将其添加到父级(tmr_box
(。