xxxxxxxxxx
<div style="position: relative; width: 400px; height: 200px; border: solid 1px blue;">
Hide me please
<div style="position: absolute; top: 10px; right: 10px;">
<button>close</button>
</div>
</div>
For further knowledge visit https://lifeincoding.com/how-to-position-one-element-relative-to-another-in-css/