新闻详情

position:absolute属性

1974 2009/3/26
<html>
<head>
<title>position属性</title>
<style type="text/css">
<!--
body{
 margin:10px;
 font-family:Arial;
 font-size:13px;
}
#father{
 background-color:#a0c8ff;
 border:1px dashed #000000;
 width:100%;
 height:100%;
}
#block{
 background-color:#fff0ac;
 border:1px dashed #000000;
 padding:10px;
 position:absolute;  /* absolute绝对定位 */
 left:20px;    /* 块的左边框离页面左边界20px */
 top:40px;    /* 块的上边框离页面上边界40px */
}
-->
</style>
   </head>
<body>
 <div id="father">
  <div id="block">absolute</div>
 </div>
</body>
</html>

相关资讯

18973218026
返回顶部