对padding和margin的使用场景还不是很清楚

原创 2019-02-05 11:33:12 233
摘要:<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <meta name="viewport" content="width=device-width,

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <meta name="viewport" content="width=device-width, initial-scale=1.0">    <meta http-equiv="X-UA-Compatible" content="ie=edge">    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.css">    <title>Document</title>    <style>        *{            padding: 0px;            margin: 0px;        }        a{            text-decoration: none;            color: #202020;            font-size: 12px;        }        .hearder{            /* height: 52px; */            width: 100%;            background-color: #FCFCFC;        }        .hearder_content{            /* height: 52px; */            width: 1032px;            /* background-color: blue; */            margin: 0px auto;            line-height: 52px;                    }        .hearder_line{            height: 2px;            width: 100%;            background-color: #FF8500;        }        .hearder_left{            /* height: 52px;            width: 400px; */            float: left;            /* background-color: red; */        }        .hearder_right{            /* height: 52px;            width: 430px; */            float: right;            /* background-color: red; */        }        .clear{            clear: both;        }        .hearder_content a{            display: inline-block;            padding-left: 16px;            padding-right: 14px;                    }        .hearder_content a:hover{            color: #FF8500;            background-color: #ccc;        }    </style></head><body>    <div class="hearder_line"></div>    <div class="hearder">        <div class="hearder_content">            <div class="hearder_left">                <a href="#" >设为首页</a>                <a href="#"  >手机新浪网</a>                <a href="#"  >移动客户端<i class="fa fa-angle-down"></i></a>            </div>            <div class="hearder_right">                <a href="#"  >登录</a>                <a href="#"  >微博<i class="fa fa-angle-down"></i></a>                <a href="#"  >博客<i class="fa fa-angle-down"></i></a>                <a href="#"  >邮箱<i class="fa fa-angle-down"></i></a>                <a href="#"  >网站导航</a>            </div>        </div>        <div class="clear"></div>    </div></body></html>

批改老师:灭绝师太批改时间:2019-02-11 09:17:18
老师总结:代码提交格式不对,padding是内边距,margin是外边距,盒模型这一节讲的很清楚,去细细听一下

发布手记

热门词条