JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<head>
<style>
html, body {
margin:0;
padding:0;
}
#EL1 {
height: 200px;
background: red;
position: fixed;
width: 300px;
top: 300px;
}
#EL2 {
width: 400px;
height: 40px;
background: orange;
cursor: pointer;
position: relative;
}
</style>
<script>
window.onload = function() {
var block_c = document.getElementById('EL1');
var block_d = document.getElementById('EL2');
if(block_c.style.display != 'none') {
block_d.style.top = parseInt(window.getComputedStyle(block_c, null).top) + parseInt(window.getComputedStyle(block_c, null).height) + 'px';
}
}
</script>
</head>
<body>
<div id='EL1'></div>
<div id='EL2'></div>
<body>
</html>