学习微信小程序之css10外边距

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
   <style>
       *{
           padding: 0 ;
           margin: 0;
       }
       .box1,.box2,.box3{
           border: 5px solid red;
           height: 100px;


       }
       .box2{
        border-color: blue;
           /*设置上右下左的外边距*/
           /*margin: 10px 0 20px 200px;*/
           /*上下为10,左右为200*/
           margin: 10px 200px;


       }
       .box4{
            900px;
           height: 300px;
           background-color: yellow;
           /*设置水平居中*/
           margin: 0 auto;
       }
   </style>

</head>
<body>
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box4"></div>
</body>
</html>

原文地址:https://www.cnblogs.com/hywbk/p/6256758.html