marginBottom 사용 JavaScript의 속성을 사용하여 하단 여백을 설정합니다.
예시
다음 코드를 실행하여 JavaScript로 요소의 아래쪽 여백을 설정할 수 있습니다 −
<!DOCTYPE html>
<html>
<body>
<p id="myID">This is demo text.</p>
<button type="button" onclick="display()">Set bottom margin</button>
<script>
function display() {
document.getElementById("myID").style.marginBottom = "95px";
}
</script>
</body>
</html>