webveuje/csspress/demo/paddiing.html
2021-01-18 18:11:23 +08:00

53 lines
1.4 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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>