JSFiddle - React, Tailwind, and code Playground

by luka kupunia

HTML

<div id="stick"></div>

CSS

body {
    margin: auto;
}
#stick {
    width: 400px;
    height: 4px;
    background: brown;
    border-radius: 2px;
    margin: auto;    
    transform: scale3d(1,1);
}

JavaScript

var elem = document.querySelector('#stick');

var a = window.getComputedStyle(elem).getPropertyValue('width');

console.log('width' , elem.getBoundingClientRect().width)
console.log('height' , elem.getBoundingClientRect().height)