我需要在其他div内做很多div,而且我似乎无法理解我的代码有什么问题,因此div不能使div的高度低于-,而这一切都是一团糟!
我的aspx代码:
<div class="tabcontent">
<div class="tabcontent-inner">
<div class="tabcontent-inner-left grid_20">
</div>
<div class="tabcontent-inner-right grid_20">
</div>
</div>
</div>
我的样式表CSS:
.tabcontent-inner {
width: inherit;
padding: 10px 10px 10px;
margin-top: 10px;
margin-bottom: 1px;
position: relative;
display: block;
}
.tabcontent-inner-left {
padding: 20px 20px;
border-left: solid 1px #ddd;
width: 45%;
float: left
}
.tabcontent-inner-right{
padding: 20px 20px;
border-right: solid 1px #ddd;
width: 45%;
float: right
}
基本上,我希望tabcontent-inner div能够了解其中的高度。
这是因为在父.tabcontent-inner上,您需要放置overflow:auto属性,以便覆盖其子代的身高
您可以在此处找到更合适的答案如何避免浮动元素的父项崩溃?
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句