我有一个父div,其定义高度(80%)和宽度(100%), 它包含两个div:
我尝试了很多东西,但我无法弄清楚如何制作它。
请查看以下codepen:http://codepen.io/anon/pen/KNMBGO
html,
body {
margin: 0;
padding: 0;
height: 640px;
width: 360px;
}
div {
border: 1px solid grey;
}
#pbzone {
height: 80%;
background-color: pink;
}
#ppzone {
float: left;
width: 100%;
display: flex;
background-color: green;
height: 20%;
}
#pgzone {
padding-top: 56.25%;
background-color: black;
background-size: cover;
border: 0px;
!important
}

<div id="pbzone">
<!-- -->
<div id="pgzone">
<!-- Always stay at a 16:9 ratio -->
</div>
<div id="ppzone">
<!-- Must fit the visible part of the pink Div (so pink-black height) -->
</div>
</div>
&#13;