新闻详情

设置父块的高度

1955 2009/3/26
<html>
<head>
<title>设置父块的高度</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;    /* 设置父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>

相关资讯

18973218026
返回顶部