【发布时间】:2014-11-30 04:50:05
【问题描述】:
我想要两个宽度和高度为 100% 的 div。我知道子 div 不起作用,因为父 div 没有特定的高度,但有办法解决这个问题吗?
HTML:
<div class="container">
<div class="child-container">
</div>
</div>
CSS:
body
{
width: 100%;
height: 100;
}
.container
{
position: relative;
min-width: 100%;
min-height: 100%;
background-image: url('http://www.earthbusinessdirectory.com/web/images/london.jpg');
}
.child-container
{
position: relative;
min-width: 100%;
min-height: 100%;
background-image: url('/images/black.png');
}
【问题讨论】: