How can I overlay a number between 0 and 99 in the middle of 'icon-star-empty'?
We don't have any Free Solid icons in Numbers.
To stack multiple icons, use the fa-stack class on the parent HTML element of the 2 icons you want to stack. Then add the fa-stack-1x class for the regularly sized icon and add the fa-stack-2x class for the larger icon. fa-inverse can be added to the icon with the fa-stack-1x to help with a knock-out looking effect.
Font Awesome is a font and icon toolkit based on CSS and Less. Glyphicons are icon fonts which you can use in your web projects.
fa-stack-2x. Used on the icon which should be displayed larger when stacked. fa-inverse. Inverts the color of the icon displayed at base size when stacked.
Simply do this from the Font Awesome docs on Stacked Icons:
<span class="fa-stack fa-lg"> <i class="fa fa-star-o fa-stack-2x"></i> <i class="fa fa-stack-1x">1</i> </span>
Here is what I use for counter overlays (badges) with FontAwesome (FA) 5.1. Unlike using the new fa-layers
method, this does not require SVG+JS. Simply add a data-count
attribute to <i>
markup...
CSS
.fas[data-count]{ position:relative; } .fas[data-count]:after{ position: absolute; right: -0.75em; top: -.75em; content: attr(data-count); padding: .5em; border-radius: 10em; line-height: .9em; color: white; background: rgba(255,0,0,.75); text-align: center; min-width: 2em; font: bold .4em sans-serif; }
Markup
<i class="fas fa-envelope" data-count="8"></i> <i class="fas fa-address-book fa-lg" data-count="16"></i> <i class="fas fa-bookmark fa-2x" data-count="4"></i> <i class="fas fa-angry fa-3x" data-count="32"></i> <i class="fas fa-bell fa-4x" data-count="2"></i>
Example
Conclusion
Some FA icon sizes may require badge size/position tweaking, but works well for my purposes. All colors/positions can be adjusted for calendar overlays, text labels, or OP's star outline.
Note
Untested, but using the same CSS should work with older FA versions by changing fas
class to fa
instead.
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