零基础学css第二天

内边距与外边距:

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <style type="text/css">
        div{
            height: 100px;/*高度*/
            width: 100px;/*宽度*/
            border: 1px solid;/*边框及边框线像素*/
            margin-top: 100px;/*距离顶部*/
            margin-left: 200px;/*距离左边*/
        }
        body{
            padding-left: 100px;/*内边距左*/
            padding-top: 100px;/*内边距上*/
        }
    </style>
</head>
<body>
    <div>123</div>
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/makangning/p/9367880.html