如何访问网页上的新星表格数字? [英] How to access proxima nova tabular figures on a webpage?
问题描述
问题是,默认情况下Proxima Nova数字不是等宽。因此,一个简单的价格表不排队。 (参见图1)
The problem is that by default Proxima Nova numbers are not monospaced. Therefore a simple price list table does not line up. (see Figure 1)
图1.未对齐的数字
问题是:
- 是否有一些CSS规则来访问等宽数字?
- 是否有一些HTML代码诀窍,因此我可以访问等宽数字作为字符? (sth like
∑
) - 或应该使用
< span class = > 1< / span>< span class =figure> 2< / span>
...?
- is there some CSS rule to access monospaced numbers?
- is there some HTML code trick so I can access monospaced numbers as characters? (sth like
∑
) - or should I use
<span class="figure">1</span><span class="figure">2</span>
...?
干杯!
推荐答案
CSS3 Fonts' font-variant-numeric
。这允许您切换Opentype功能。在你的情况下,这将是:
CSS3 Fonts’ font-variant-numeric
. This allows you to toggle Opentype features. In your case this would be:
.my-element { font-variant-numeric: tabular-nums; }
Proxima Nova 列表支持表格数字,这是很好,但我不确定浏览器是否支持font-variant-numeric。如果这不起作用,那么您可以尝试 font-feature-settings
,它应该给你与(可能)更多支持:
Proxima Nova lists support for tabular figures so that’s good, but I’m not sure about browser support for font-variant-numeric. If that doesn’t work then you could try font-feature-settings
instead which should give you the same effect with (possibly) more support:
.my-element { font-feature-settings: "tnum" on; }
规范确实说:
作者通常应尽可能使用'font-variant'及其相关的子属性。
Authors should generally use ‘font-variant’ and its related subproperties whenever possible.
这篇关于如何访问网页上的新星表格数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!