JSFiddle - React, Tailwind, and code Playground

by Koubenec

HTML

<div class="jsbar">This is dynamically created</div>
<div class="page" id="test">
    <header>The header bar</header>
   <div class="content">the content here </div>
</div>

CSS

.page {
    background:#f8f8f8;
    height:900px;
}
header {
    position:fixed;
    top:40px;
    background:#eee;
    height:10px;
}
.jsbar {
    position: fixed;
    top: 0px;
    background:#ccc;
    height:40px;
}

JavaScript

var height = $('.jsbar').outerHeight(true);

//$('.page').css("margin-top", height+"px");

var main = document.getElementByID("test");
main.style["margin-top"] = "100px";