<!doctype html>
<html>
<head>
    <title>Position</title>
    <meta charset="utf-8" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style type="text/css">
         .large {
             font-size: 200%;
         }
         #blue {
             color: blue;
         }
         .underline {
             text-decoration: underline;
         }
         .bold {
             font-weight: bold;
         }

       .box1 {
            background-color: #46f7d8;
            width: 300px;
            height: 100px;
            position: relative;
            /*相對值*/

            position: absolute;
            /*絕對值*/

            position: fixed;
            /*固定的*/

            position: static;
            /*靜態的*/
            top: 80px;
            left: 100px;
            z-index: 1;

        }
        .box2 {
            background-color: red;
            width: 200px;
            height: 300px;
            position: relative;
            z-index: 2;

        }

        .clear{
            clear: both;
        
    </style> 
</head>

<body>
<div class="box1">
    <p class="large">This is some text.</p>
</div> 

<div class="box2">
    <p id="blue" class="large">This is some more text.</p>
</div>  


<div class="clear"></div>

    <p>The third <span class="underline large bold">word</span> in this paragraph</p>

    
</body>
</html>
 

 

position.jpg

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 A&B 的頭像
    A&B

    網頁前端新手上路辛酸史

    A&B 發表在 痞客邦 留言(0) 人氣()