CSS height 实例
html公开前 25 行,完整代码需登录
<style>
.height-demo {
background-color: #e8e8e8;
padding: 10px;
}
.height-item {
background-color: #2196F3;
border: 1px solid #000;
color: white;
font-size: 18px;
font-weight: bold;
text-align: center;
padding: 10px;
margin: 5px 0;
}
.height-fixed {
height: 80px;
}
.height-auto {
height: auto;
}
</style>
<div class="height-demo">
<div class="height-item height-fixed">固定高度 80px</div>
<div class="height-item height-auto">自动高度(由内容决定)</div>