I have a card to which I would like to apply some basic animation like - zoom in effect and border color change on hover. I have tried several methods but nothing is working for me. Many similar questions have been asked before, and I tried a few but not getting satisfactory result.
Below is my code -
HTML
<div class="container">
<a class=" text-decoration-none " href="">
<div class="card">
<img class="icon" src=""/>
<div class="card-text">
AlphaBetaGamma
</div>
<div class="d-flex align-items-center justify-content-end">
<span class="read-more">READ MORE</span>
<i class="fas fa-arrow-circle-right"></i>
</div>
</div>
</a>
</div>
CSS-
.card .read-more:hover{
font-size: 14px;
}
.card :hover{
box-shadow: 8px 8px 8px blue;
}
The box shadow part is not working for some reason. I would also like the text on the card to grow a little when the card zooms and a blue shadow should add.
How can I achieve this ?
For smooth transitional effects, add 'transition' to the element you'd like to target. Then in the hover selector, change the dimensions and it should happen with a smoother transition.
Same with color changes etc.. This is just one of the ways.
.card .read-more:hover{
font-size: 14px;
}
.card:hover{
box-shadow: 8px 8px 8px blue;
transform:scale(1.2);
}
.card{
height:200px;
width:200px;
border:1px solid black;
transition:.3s;
margin: 3rem;
}
<div class="container">
<a class=" text-decoration-none " href="">
<div class="card m-5">
<img class="icon" src=""/>
<div class="card-text">
AlphaBetaGamma
</div>
<div class="d-flex align-items-center justify-content-end">
<span class="read-more">READ MORE</span>
<i class="fas fa-arrow-circle-right"></i>
</div>
</div>
</a>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With