所有可用于谷歌字体的字体权重是多少?

时间:2017-03-27 03:57:31

标签: css css3 google-webfonts

例如,我可以像这样导入:

@import url(http://fonts.googleapis.com/css?family=Roboto:100,400,900);

但我是否也可以这样做,并且它是否有意义(唯一有效的值100,400,900)?

@import url(http://fonts.googleapis.com/css?family=Roboto:100,200, 300, 400,500, 600, 700, 800, 900);

3 个答案:

答案 0 :(得分:1)

这取决于字体。如果您在Google Fonts并且选择了字体。然后选择右下方的family selected,然后点击customize标签,您可以看到该字体支持的所有字体粗细。

您当前的示例正是如果支持这些字体粗细的样子。这是roboto,其中包含所有可能的字体粗细和样式。

@import url('https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i');

i代表斜体

要使用这些字体,请执行

.this-is-my-class {
    font-family: 'Roboto';
    font-weight:100; // or 100 - 900
    font-style: italic; // or normal 
 }

答案 1 :(得分:1)

可能这个答案适合你

请通过此链接

Specifying Style and Weight for Google Fonts

答案 2 :(得分:1)

取决于选择字体enter image description here

时生成的内容

选择权重时生成: enter image description here

相关问题