I hope you can help me with this question I have regarding CSS.
You see, I have my parent element with a child element, which I want to appear when the mouse is positioned on the parent element.
The child element initialized it with a height of 0px
, and when I positioned on the father I changed the height of the son, but I would like to know if there is any way to show the son's elements when he has reached his maximum height.
Example:
.container {
position: relative;
width: 300px;
height: 200px;
display: flex;
align-content: center;
justify-content: center;
border: 1px solid #FFF;
background-color: #FFAB91;
color: #424242;
}
.container:hover .show {
visibility: visible;
height: 80px;
}
.container:hover button {
visibility: visible;
}
.show {
visibility: hidden;
position: absolute;
bottom: 0;
background-color: #D84315;
color: #FFF;
width: 100%;
height: 0px;
transition: all 0.5s ease-in;
display: flex;
justify-content: center;
align-items: center;
}
button {
visibility: hidden;
transition: all .5s ease-in;
}
<div class="container">
<h5>Categoría 1</h5>
<div class="show"><button>Ver +</button></div>
</div>
<div class="container">
<h5>Categoría 2</h5>
<div class="show"><button>Ver +</button></div>
</div>
<div class="container">
<h5>Categoría 3</h5>
<div class="show"><button>Ver +</button></div>
</div>