【发布时间】:2016-04-14 12:09:52
【问题描述】:
我对父母和孩子div 有问题。我必须将它们设置为height: auto; 和min-height: 100%;。但是父 div 停留在 100% 的高度。我应该如何设置它也会计算其子 div 的高度?
谢谢!
代码在这里:
#akce{
background: url('akce.png') center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: auto;
min-height: 100%;
display: block;
}
#text-correct{
background-color: rgba(0,0,0,0.5);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: auto;
min-height: 100%;
}
【问题讨论】:
-
我真的不明白你想要达到什么目的;能否请您更好地解释一下(加上您的 html)?