98-100 css外边距

 

  

<!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>外边距</title>
    <style>
        div {
            margin: 70px;
            border: 1px solid red;
        }

        p {
            border: 1px solid rgb(4, 0, 255);
            margin-top: 100px;
            margin-bottom: 100px;
            margin-left: 150px;
            margin-right: 80px;
            background-color: brown;

        }
    </style>
</head>

<body>
    <h1>css外边距设置 </h1>
    <div>本div标签元素的外边距为 70 像素。</div>

    <h2>使用单独的外边距属性</h2>
    <p>这个p 元素的上外边距为 100 像素,下外边距是 100 像素,右外边距是 150 像素,左外边距是 80 像素。</p>
</body>

</html>

效果

   

 

posted @ 2022-02-07 17:07  优敏行  阅读(34)  评论(0)    收藏  举报