Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<style>
#myDIV {
  height: 250px;
  width: 400px;
  padding: 10px;
  margin: 15px;
  border-top: 15px solid black;
  border-left: 10px solid red;
  background-color: lightblue;
}
</style>
<body>
<h1>The Element Object</h1>
<h2>The clientTop and clientLeft Properties</h2>
<p>Display the width of myDIV's top and left border:</p>
<div id="myDIV">
  <p id="demo"></p>
</div>
<script>
const element = document.getElementById("myDIV");
let text = "clientTop: " + element.clientTop + "px<br>";
text += "clientLeft: " + element.clientLeft + "px";
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>