(066)css_position_relative&absolute

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <title>layout_relative_absolute.html</title>
    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
    <style type="text/css">
        #box1{
            width:200px;
            height:200px;
            border:1px solid blue;
            position:relative;
        }
        #box2{
             position:absolute;
            top:20px;
            left:30px;
            border:1px solid green;
        }
        
        #box3{
            width: 200px;
            height: 200px;
            border:1px solid pink;
            position: relative;
        }
        
        #box4{
            position: absolute;
            bottom: 3px;
        }
        
    </style>
  </head>
  
  <body>
        <div id="box1">
            <div id="box2">相对参照元素进行定位</div>
        </div>

        <h1>下面是任务部分</h1>
        <div id="box3">
            <img src="http://img.mukewang.com/541a7d8a00018cf102000200.jpg">
            <div id="box4">当我还是三年级的学生时是一个害羞的小女生。</div>
        </div>
  </body>
</html>

 

posted @ 2015-01-27 15:20  雪中飞雁  阅读(120)  评论(0)    收藏  举报