If you're looking to design a card with three child divs, where only one is visible at a time and transitions smoothly as the user progresses through steps 1, 2, and 3, then you've come to the right place.
In the code snippet provided below, the parent container's height should be dynamically set to span only 30px, matching the height of the children divs. This ensures a neat overlap effect when transitioning from one child div to another.
.container {
border-style: solid;
border-width: 2px;
width: 30px; /* Dynamically set */
}
.childOne {
position: relative;
height: 30px;
background-color: red;
}
.childTwo {
position: relative;
top: -30px;
height: 30px;
background-color: blue;
}
<div class='container'>
<div class='childOne'></div>
<div class='childTwo'></div>
</div>