53 lines
1.4 KiB
HTML
53 lines
1.4 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>Document</title>
|
||
<style>
|
||
.box{
|
||
width:600px;
|
||
height:300px;
|
||
background: gold;
|
||
/* padding-top:50px;
|
||
border-top: 1px solid white;
|
||
overflow: hidden; */
|
||
}
|
||
.box1{
|
||
background:red;
|
||
/* padding: 30px; */
|
||
/* margin-top: 50px; */
|
||
}
|
||
.box2{
|
||
background: blue;
|
||
/* padding-left: 20px;
|
||
padding-top: 20px;
|
||
padding-right: 20px;
|
||
padding-bottom: 20px; */
|
||
/* padding:20px 10px; */
|
||
padding: 30px 20px 5px;
|
||
/* padding: 40px 20px 5px 10px; */
|
||
}
|
||
.box3{
|
||
background:pink;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<span class="box2">盘古</span>
|
||
<span class="box3">女娲</span>
|
||
|
||
<div class="box1">京东</div>
|
||
|
||
<p>
|
||
总结:padding 一个值得时候定义的是上下左右四个方向的边距
|
||
<p>两个值得时候定义的前一个值是上下的边距 后面的值是左右的边距</p>
|
||
<p>三个值得时候第一个值是上边距 第二个值是左右边距 第三个值是下边距</p>
|
||
<p>四个值得时候是上右下左的边距</p>
|
||
|
||
|
||
|
||
</p>
|
||
|
||
</body>
|
||
</html> |