하단 패딩을 설정하려면 paddingBottom을 사용하세요. JavaScript의 속성
예시
다음 코드를 실행하여 JavaScript로 요소의 아래쪽 패딩을 반환할 수 있습니다. −
<!DOCTYPE html>
<html>
<head>
<style>
#box {
border: 2px solid #FF0000;
width: 150px;
height: 70px;
}
</style>
</head>
<body>
<div id = "box">This is demo text.</div>
<br>
<br>
<button type = "button" onclick = "display()">Bottom padding</button>
<script>
function display() {
document.getElementById("box").style.paddingBottom = "100px";
}
</script>
</body>
</html>