盒子模型

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>盒子模型</title>
        <style type="text/css">  
            .bigbox{
                width: 600px;
                height: 500px;
                border: 5px solid orangered;

                /* padding:内边距 */
                /* top:上 bottom:下 left:左 right:右 center:中 */
                /* padding-top: 50px */
                /* padding-left:100px */
                /* 复合写法:
                    padding: 50px=上 70px=右 80px=下 100px=左 (顺时针走向);
                    padding: too left/right bottom;
                    padding: 一个代表上下,一个代表左右;
                    padding: 上下左右;
                    */

                padding: 50px 70px 80px 100px;
                /* 加了内边距盒子会被撑大 
                   横向: width + padding-left + padding-right;
                   纵向: height + padding-top + padding-bottom;
                */
               /* 外边距:margin */
               /* margin-top: 200px
                  margin-left: 400px
                  margin: 上 右 下 左
                  margin: top left/right bottom
                  margin: 上/下 左/右
                  margin: 上/下/左/右
                  左右外边距为auto的时候,盒子水平剧中

               */
               
               margin: auto;
            }
            .box{
                width: 300px;
                height: 200px;
                border: 5px dotted gold;
            }
        </style>
    </head>
    <body>
        <div class="bigbox">
            <div class="box"></div>
        </div>
        
    </body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值