設(shè)置父塊的高度
文章導(dǎo)讀:
<html>
<head>
<title>設(shè)置父塊的高度</title>
<style type="text/css">
<!--
div.father{ /* 父div */
background-color:#fffebb;
text-align:center;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
padding:10px;
border:1px solid #000000;
height:40px; /* 設(shè)置父div的高度 */
}
div.son{ /* 子div */
background-color:#a2d2ff;
margin-top:30px; margin-bottom:0px;
padding:15px;
border:1px dashed #004993;
}
-->
</style>
</head>
<body>
<div class="father">
<div class="son">子div</div>
</div>
</body>
</html>