有没有办法在CSS中指定使用文本或标题数字? [英] Is there a way to specify the use of text or titling figures in CSS?
问题描述
我选择的字体通常默认为文字数字
My fonts of choice usually default to text figures
这是我喜欢的一个原因。但是,对于表格或标题,我想指定使用衬里数字:
which is one reason I like them. However, for tables or headings I'd like to specify that lining figures should be used:
在CSS中有办法吗?
(支持搜索:
- 旧式数字,文字数字,非衬线数字,中世纪数字
- 内嵌数字,标题数字)
推荐答案
Firefox 4.0基本< a href =https://developer.mozilla.org/en/CSS/-moz-font-feature-settings =nofollow>文字数字支持。以下是开启文字(旧式)图形的方法:
Firefox 4.0 has basic text figure support. Here's how to turn on text (old-style) figures:
.text-figures {
-moz-font-feature-settings: "onum=1";
}
看起来有一组css3属性,例如 font-variant-numeric ,以控制常用属性。
Looks like there's a set of css3 properties, such as font-variant-numeric, to control common properties. These are not yet supported by any browser, as far as I know.
这里有一个 jsFiddle 在那里你可以玩的风格。它在衬里和老式的人物之间切换。我在Windows 7上使用Minion Pro,因此您可能必须在其他平台上找到自己支持的字体。
Here's a jsFiddle where you can play around with the styles. It toggles between lining and old-style figures. I'm using Minion Pro on Windows 7, so you might have to find your own supported font on other platforms.
这篇关于有没有办法在CSS中指定使用文本或标题数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!