如何确保每个字形都具有相同的宽度? [英] How do I make sure every glyph has the same width?
问题描述
我注意到,即使使用相同的字体大小,也没有标准的宽度.如何在项目列表前使用这些字词,以免单词出现锯齿?
I've noticed that even at the same font size, there is not a standard width. How can I use these in front of a list of items so the words don't appear jagged?
问题的屏幕截图:
这是代码:
<ul id="myTab">
<li class="active"><a href="#home"><i class="icon-tasks"></i> Proposal</a></li>
<li><a href="#video"><i class="icon-film"></i> Videos</a></li>
<li><a href="#asset"><i class="icon-paper-clip"></i> Assets</a></li>
<li><a href="#payment"><i class="icon-credit-card"></i> Payment</a></li>
<li><a href="#history"><i class="icon-calendar empty"></i> History</a></li>
</ul>
推荐答案
从3.1.1开始,您可以使用icon-fixed-width
类,而不必编辑CSS.
Since 3.1.1, you could use the icon-fixed-width
class instead of having to edit the CSS.
http://fortawesome.github.io/Font-Awesome /3.2.1/examples/#navigation
从4.0开始,您应该使用fa-fw
:
4.x https://fontawesome.com/v4.7.0/examples/#fixed-宽度
5.x https://fontawesome.com/如何使用/在网络上/样式/固定宽度图标
Since 4.0, you should use fa-fw
:
4.x https://fontawesome.com/v4.7.0/examples/#fixed-width
5.x https://fontawesome.com/how-to-use/on-the-web/styling/fixed-width-icons
感谢@kalessin指出.
Thanks @kalessin for pointing out.
这篇关于如何确保每个字形都具有相同的宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!