我想设置div的最大高度,设置高度自动,就像在代码下一样。
.background.left-sidebar {
height: auto !important;
padding-bottom: 0;
right: 0;
width: 300px;
background-color: #999999;
margin-top: 40px;
margin-right: 300px;
}
.left-sidebar {
height: auto;
width: 300px;
padding-bottom: 0px;
}
.left-sidebar-top {
width: 100%;
height: 300px;
background-color: #996699;
}
<div class="right_block left-sidebar">
<div class="content">
<div class="top_block left-sidebar-top">
<div class="content">
</div>
</div>
<div class="marker">This</div>
</div>
</div>
我尝试设置height:100%
和height:auto
,但它不起作用。
如何在CSS中设置自动高度的最大高度?
https://stackoverflow.com/questions/39163244
复制相似问题