I am using font-awesome with bootstrap 4 cards, is there anyway to increase the size of the font-awesome icon (bottom right) when I mouse over the button?
in this case <i class="fa fa-folder-open fa-5x"></i>
Here is the HTML
<div class="col-md-3 col-sm-6">
<div class="card card-inverse card-success">
<div class="card-block bg-success">
<div class="rotate">
<i class="fa fa-folder-open fa-5x"></i>
</div>
<center><a class="btn btn-success show" target="1" role="button"><h5 class="text-uppercase">open cases <i class="fa fa-arrow-circle-right fa-1x"></i></h5></a></center>
<h1 class="display-1"><center>7</center></h1>
</div>
</div>
</div>
Here is what it presently looks like
look maybe this help you
.rotate .fa.fa-folder-open:hover{
font-size:6em;
transition: 1s ease-out;
}
example
Use .card:hover > .card-block > .rotate > .fa { }
to target the icon.
Then you can use font-size: 6em;
to enlarge the font or use the transform: scale()
css.
Both look better adding a transition
for the .fa
so it will animate on hover.
EDIT: The transition
should be set on .card > .card-block > .rotate > .fa { }
(so without the :hover
).
Example:
.card > .card-block > .rotate > .fa { transition: font-size 0.35s ease; }
.card:hover > .card-block > .rotate > .fa { font-size: 5em; }
(Don't forget to add extra rules with prefixes for cross-browser compatibility, see caniuse.com or W3schools for reference.)
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