css不同的字体大小不同的家庭 [英] css different font sizes on different families
问题描述
我有一个CSS声明如下:
I have a CSS declaration like this:
font-family: font1, font2, font3;
,其中font1是嵌入式EOT / TTF字体,但问题是,这种字体是比小其他字体,所以我想有一个不同的字体大小(1.8em)这种字体(font1)。所有其他字体(font2,font3)保持不变。
where font1 is an embedded eot/ttf font, but the problem is that this font is smaller than the other fonts so I want to have a different font-size (1.8em) for this font (font1). All other fonts (font2, font3) stay untouched.
现在的问题是,如果用户的浏览器使用font1,font2或font3我无法验证。是否有任何CSS声明,允许不同的字体,大小不同的家庭?
The problem is, that I cannot verify if the user's browser uses font1, font2 or font3. Is there any css declaration which allows different font-sizes for different families?
感谢。
推荐答案
是可以做到这一点,但它是现在非常支持。您正在寻找的CSS属性是 font-size-adjust
- 一个新的CSS3属性,专门解决这个问题。规范说:
There is a way to do this, but it's as of now very badly supported. The CSS property you are looking for is font-size-adjust
- a new CSS3 property introduced specifically to address this problem. The specification says:
在出现字体后退
的情况下,后备字体可能不会共享
相同的宽高比作为所需的
字体系列,因此会出现较少的
可读。 font-size-adjusting
属性是一种在字体后退
发生时保持文本的
可读性的方法。它通过调整
font-size来实现这一点,使得x-height是
,与所使用的字体无关。
In situations where font fallback occurs, fallback fonts may not share the same aspect ratio as the desired font family and will thus appear less readable. The font-size-adjust property is a way to preserve the readability of text when font fallback occurs. It does this by adjusting the font-size so that the x-height is the same irregardless of the font used.
但是,它只支持在Firefox的现在,所以你可能想寻找替代品。
However, it is only supported in Firefox as of now, so you might want to look for alternatives.
有关如何使用它的示例,请参阅:
For examples of how to use it, see:
http://webdesignernotebook.com/css/the-little-known-font-size-adjust -css3-property /
https: //developer.mozilla.org/en/CSS/font-size-adjust
http://www.fonttester.com/help/css_property/font-size-adjust.html
http://www.w3.org/TR/css3 -fonts /#relative-sizing-the-font-size-adjust-pro
这篇关于css不同的字体大小不同的家庭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!