<!doctype html>
<html>
<head>
    <title>Block&Inline</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">

        body{

            background:url("Image/flat.png") no-repeat right top;
        }

        h1,p{
            color: black;
        }

        h1{

            background-color: rgba(75,223,148,0.5);
        }

        p{
            background-color: Tomato;
        }

        section{

            background-color: orange;
            max-width: 150px;


        }
        .myborder1{
            /*border:5px solid black; */
            margin-bottom: 60px; 
            
        }

        .myborder2{
            /*border:5px solid black;*/  
            margin-top: 50px;
            padding: 50px;
            box-sizing: border-box;
        }

        li{
            list-style: none;
        }

        .inline{
            display: block;
        }

    </style>    
</head>

<body>
<div>
    <h1>Example Domain</h1>
    <p>This domain is established to be used for illustrative examples in documents. You may use this
    domain in examples without prior coordination or asking for permission.</p>
    <section class="myborder1">This is a text1</section>
    <section class="myborder2">This is a text2</section>
    <br>
    <li><a href="#">Page1</a></li>
    <li><a href="#">Page2</a></li>
    <li><a href="#">Page3</a></li>
    <a class="inline" href="#">Page4</a>
    <a class="inline" href="#">Page5</a>
    <a class="inline" href="#">Page6</a>

//a元素屬inline區塊,利用li包覆轉化成block區塊(li屬block區塊)

//CSS中設定a元素轉化成block區塊元素,是一樣的成效


</div>
</body>
</html>

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

    網頁前端新手上路辛酸史

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