JSFiddle - React, Tailwind, and code Playground

HTML

<div style="background-color:green">

</div>

CSS

div{
  background-color: red;
  width: 100px;
  height: 100px;
}

JavaScript

var div = document.querySelector('div')

console.log(window.getComputedStyle(div).backgroundColor)
console.log(div.style.backgroundColor)

console.log(window.getComputedStyle(div).width)
console.log(div.style.width)