JSFiddle - React, Tailwind, and code Playground
by Vaniljs
HTML
<div class="box">
<div class="mini">
<p class="text">
Борис
</p>
</div>
</div>
CSS
.box {
width:100%;
height:100vh;
background-color: black;
display: flex;
justify-content: space-around;
align-items:center;
}
.mini {
width:100px;
height:50px;
background-color: coral;
}
.text {
text-align: center;
}
JavaScript
let el = document.querySelector('.box')
el.addEventListener('click', function(e) {
if (e.target.classList.contains('box')) {
el.style.display = 'none'
}
})