<!doctype html>
<html>
<head>
    <title>Margin</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: 200px;
            height: 200px;
            margin: 100px 50px 80px 20px;
                   /*上    右   下   左*/

            margin-top: 100px;
            margin-right: 50px;
            margin-bottom: 80px;
            margin-left: 20px;

            /*margin 邊距 (兩種方式設定 ↑ )*/
        }

        .box2 {
            background-color: red;
            width: 400px;
            height: 500px;
        }

        .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>

 

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

    網頁前端新手上路辛酸史

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