问题
Looking through the examples on the fontawesome website, I notice a few make use of the class fa-fw
. For example:
<i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i>
I have tried with and without it and I cannot see any notable difference.
What is the purpose of the fa-fw
class?
回答1:
Fixed Width Icons
I've opened the sample page in Chrome, opened inspector on the "Library"-Element of the fw-sample and removed the fw
-class. This messes up the icon-alignment - and that is also mentioned as the purpose of fw: ensuring proper alignment of the icons :-)
回答2:
Icon size, some icons are bigger, if you use fa fa-fw, the size of the icon will be the same regardless of how big/small it should be.
来源:https://stackoverflow.com/questions/41140132/what-is-the-purpose-of-the-fa-fw-class