I am trying to reveal my p
text it doesn’t using transition.
I’m trying to resolve it from hour but does not understand why it’s not working.
.section-about--card {
width:100%;
height: 15rem;
border: 1px solid black;
transition: all 1s linear;
& .about-card--details {
text-align: center;
text-transform: capitalize;
height: 0px;
overflow: auto;
}
&:hover .about-card--details{
height:50px;
}
}
<div class="section-about--card">
<p class="about-card--details">
some text
</p>
</div>
2
Answers
I am not sure you want to either make the font of the text bigger or you want to make the height of the text container bigger.
lets cover both situation:
in your example, you just need to add background color to .about-card–details like
background-color: yellow;
to make it more noticeableand you have your transition on the wrong spot
please move
transition: all 1s linear;
to& .about-card--details
becasue you want transition to be done on.about-card--details
second sitution if you want to make the font bigger you simply do the following:
CSS
Transition
will not be inherited by child elements. Add the transition to the child.about-card--details
.