JSFiddle - React, Tailwind, and code Playground

by Patrick Read

HTML

<div class="parent">
  <div class="child">Child - To Be Shown</div>
    
  Parent - To Be Hidden
</div>
<div class="following-sibling">
  Sibling - Right Under Child
</div>

CSS

.parent>.child
{
  width: 200px;
  visibility: visible;
  background-color: rgba(0, 0, 255, 0.5);
}

.parent
{
  visibility: hidden;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
}

.following-sibling
{
  background-color: rgba(255, 0, 0, 0.5);
  width: 100px;
  height: 100px;
  padding-top: 20px;
}