DIV高度随着宽度而变化
2016-11-07 本文已影响39人
晓函
<style>
.father {
width: 70%;
}
.daughter {
width: 90%; height: 0;
padding-bottom: 50%;
background: black;
}
</style>
<div class = "father">
<div class = "daughter">
<img src="...">
</div>
</div>