CSS의 padding 속성을 사용하면 padding-top, padding-right, padding-bottom, padding-left에 대한 패딩을 설정할 수 있습니다. 약식 속성입니다.
먼저 예를 살펴보겠습니다 -
예:패딩:10px 5px 7px 10px;
여기,
top padding is 10px right padding is 5px bottom padding is 7px left padding is 10px
예시
다음 예는 CSS 패딩 속성을 보여줍니다 -
<!DOCTYPE html>
<html>
<head>
<style>
div {
height: 150px;
width: 300px;
padding: 5% 10% 20% 5%;
background-image: url("https://www.tutorialspoint.com/images/home_tensor_flow.png");
text-align: center;
font-weight: bold;
font-size: 1.2em;
box-sizing: border-box;
}
div > div {
border-radius: 80px;
padding: 2em 2em;
box-shadow: 0 0 4px 0.8px black;
}
</style>
</head>
<body>
<div>Learn TensorFlow
<div>TensorFlow is an open source machine learning framework for all developers.</div>
</div>
</body>
</html> 출력
이것은 다음과 같은 출력을 제공합니다.

예시
<!DOCTYPE html>
<html>
<head>
<style>
div {
height: 150px;
width: 100px;
padding: 5% 1%;
background-color: papayawhip;
border-radius: 5%;
box-sizing: border-box;
}
div > div {
width: 50px;
height: 50px;
border-radius: 50%;
padding: 2em;
box-shadow: 0 0 9px 1px black;
}
span {
padding: 10px;
}
</style>
</head>
<body>
<div>
<div></div>
<span><i>button</i></span>
</div>
</body>
</html> 출력
이것은 다음과 같은 출력을 제공합니다 -
