JSFiddle - React, Tailwind, and code Playground

by Ronny

HTML

<div id="toolbar">Toolbar</div>
<div id="page">
    <button>click</button>
    <div class="popup">popup</div>
</div>

CSS

#toolbar {position: fixed; top: 0; left: 0; width: 100%; background: #cdcdcd; height: 34px;}
html,body {padding-top: 34px;}
#page {position: relative; top: 0px; background: yellow;margin:0;padding:0;}
.popup {display: none; background: hotpink; padding: 20px; position: absolute;}

JavaScript

$('button').click(function(){
    $('.popup').css({
        'top': $('#page').offset().top,
        'display': 'block'
    });
});