天天看點

html+css實戰92-組成

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 紙箱子, 填充泡沫 */
        div {
            width: 300px;
            height: 300px;
            background-color: pink;
            /* 邊框線 == 紙箱子 */
            border: 1px solid #000;
            /* 内邊距 == 填充泡沫 : 出現在内容和盒子邊緣之間 */
            padding: 20px;

            /* 外邊距 : 出現在兩個盒子之間, 出現在盒子的外面*/
            margin: 50px;
        }
    </style>
</head>
<body>
    <div>内容電腦</div>
    <div>内容電腦</div>
</body>
</html>