JSFiddle - React, Tailwind, and code Playground

by Paul Lan

HTML

<div id="cart" class="header" style="height: 100px;">Cart</div>

<p>Cart 的最终颜色值是: <span id="applied_color"></span></p>

<p>Cart的最终高度是: <span id="applied_height"></span></p>

CSS

#cart {
    color: #00ff00;
}
.header {
    color:#ffffff;
    height: 200px;
    border:2px solid #000000;
}

JavaScript

var getColor = window.getComputedStyle(jQuery("#cart").get(0)).getPropertyValue('color');
$('#applied_color').html(getColor);

var getHeight = window.getComputedStyle(jQuery("#cart").get(0)).getPropertyValue('height');
$('#applied_height').html(getHeight);