HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>padding - ๊ฐ๋ณ ์์ฑ</title>
<link rel="stylesheet" href="css/02_padding_property.css">
</head>
<body>
<center><h1>padding ๊ฐ๋ณ ์์ฑ</h1></center>
<div class="container">
<!-- .item.box$*4 -->
<div class="item box1"></div>
<div class="item box2"></div>
<div class="item box3"></div>
<div class="item box4"></div>
</div>
</body>
</html>
HTML
๋ณต์ฌ
CSS
.container {
position: relative;
width: 1200px;
border: 3px solid orange;
text-align: center;
}
.item {
width: 100px;
height: 100px;
line-height: 100px;
border: 1px solid gray;
background-color: #ddd;
}
.box1 { padding-top: 20px; /* pt20 */ }
.box2 { padding-right: 40px; /* pr40 */ }
.box3 { padding-bottom: 60px; /* pb60 */ }
.box4 { padding-left: 80px; /* pl80 */ }
CSS
๋ณต์ฌ