JSFiddle - React, Tailwind, and code Playground

HTML

<div id="yellowbar">
  This is the original text
    <div id="xbtn">
       hello
    </div>
</div>

CSS

#yellowbar {
    position:fixed;
    left:0;
    width:80%; /*change to 100%*/
    height:30px;
    background:#e90;
}
#xbtn {
    height:10px;
    line-height:5px;
    float:right;
    font-family: sans-serif;
    padding:3px;
    margin-right:10px;
    box-shadow:0px 0px 2px 2px #eee;
    background:#333;
    border-radius:2px;
    color: white;
    font-weight:bold;
    margin-top:5px;
    padding-top:3px;
}

JavaScript

$("#xbtn").click(function(){$("#yellowbar").hide()});