https://www.w3schools.com/code/tryit.asp?filename=GG4COP8QYCSM
Following is the code in that link
Here when tooltip is hidden it takes up space.
What is the way to place tooltip divs so that they don't take space when hidden and don't cause other elements to move from their positions?
.border {
background-color: pink;
padding: 10px;
margin: 15px;
}
.parent {
background-color: red;
border: 2px solid blue;
margin: 15 px;
padding: 5px;
}
.child {
display: table-cell;
background-color: white;
border: 5px solid black;
margin: 15 px;
padding: 5px;
}
.tooltipText {
visibility: hidden;
}
<div class="border">
<div class="parent">
<div class="tooltipText"> Tootltip</div>
<div class="child"> one </div>
<div class="child"> two </div>
<div class="child"> three </div>
</div>
</div>