JSFiddle - React, Tailwind, and code Playground
HTML
<div class="box">Dimentions are:
<br />200x200 px</div>
CSS
.box {
width: 200px;
height: 200px;
overflow: hidden;
margin: 10px 0;
border: 10px solid #999999;
cursor: pointer;
background-color: #cccccc;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
JavaScript
var box = document.querySelector('.box');
var gBCR_width = box.getBoundingClientRect().width;
var wGCS = window.getComputedStyle(box).width;
alert('getBoundingClientRect: ' + gBCR_width + '\ngetComputedStyle: ' + wGCS);