I recently designed a card using HTML where the text only appears when hovered over. I am now looking to modify the HTML and CSS so that the text div is displayed when the parent div is being hovered over.
.bg {
background-color: white;
width: 200px;
height: 300px;
border: solid red 2px;
overflow: hidden;
}
.text {
background-color: gray;
position: relative;
top: 180px;
transition: top 0.5s;
}
.bg:hover .text{
top: 132px
}
<div class="bg">
<div class="text">
<h3>Test text</h3>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Reiciendis voluptas pariatur qui aut animi molestiae quia veritatis culpa excepturi. Nesciunt optio ipsa molest</p>
</div>
</div>