JSFiddle - React, Tailwind, and code Playground
by Facundo Victor
HTML
<div class="container">
<p id="element"> Some Cool content</p>
</div>
<p>
MORE TEXT
</p>
CSS
.container {
background: lightblue;
padding: 10px;
height: 100px;
width: 500px;
}
p {
display: block;
border: 1px solid red;
margin-top: 50%;
}
JavaScript
window.onload = function(evt) {
var element = document.getElementById("element"),
style = element.currentStyle || window.getComputedStyle(element);
element.textContent = "the margin-top is : " + style.marginTop;
};