css - 谷歌字体有哪些可用的字体粗细?

标签 css 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);

最佳答案

这取决于字体。如果您在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 
 }

关于css - 谷歌字体有哪些可用的字体粗细?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43037720/

相关文章:

html - [html5和css3]如何水平和垂直对齐三个不同大小的div而不留空隙

html - IE9 中的渐变 + 圆 Angular CSS 问题

html - 应用网络字体样式时,文本 Logo 不规则地改变形状

android - Google Web Fonts 不适用于 Android 4.2.2 高棉语

html - 我如何在一个 div 中设置这两个图像的样式?

css - 为什么具有z-index值的元素不能覆盖其子级?

html - 如何删除 Bootstrap 中列之间的装订线(间距)?

html - 谷歌字体不适用于 IE9

css - Lato 中未显示箭头

css - 什么是网络字体,我可以依赖它们吗