Javascript DOM CSS Style paddingBottom Property set

Introduction

Change the bottom padding of a <div> element back to "normal":

document.getElementById("myDiv").style.paddingBottom = "0px";

View in separate window

<!DOCTYPE html>
<html>
<head>
<style>
#myDiv {//  w ww  .j a va2  s  .  c  o  m
  border: 1px solid #FF0000;
  padding-bottom: 75px;
}
</style>
</head>
<body>

<div id="myDiv">This is a div.</div>
<br>
<button type="button" onclick="myFunction()">Change bottom padding</button>

<script>
function myFunction() {
  document.getElementById("myDiv").style.paddingBottom = "0px";
}
</script>

</body>
</html>



PreviousNext

Related