How to add badge on top of Font Awesome symbol?

后端 未结 5 804
温柔的废话
温柔的废话 2020-12-12 10:56

I would like to add badge with some number (5, 10, 100) on top of the Font Awesome symbol (fa-envelope). For example:

5条回答
  •  执念已碎
    2020-12-12 11:07

    http://jsfiddle.net/zxVhL/16/

    By placing the badge inside the icon element I was able to position it relative to the bounds of the icon container. I did all the sizing using ems so that the size of the badge is relative to the size of the icon and this can be changed by simply changing the font-size in .badge

提交回复
热议问题