css - 导入和使用 google webfont

标签 css fonts google-font-api

对于一个元素,我必须使用一种字体的多种样式。 这是the google font的链接

这是我的CSS导入

@import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,300,400,700);

我想知道的是如何定义要显示的字体系列,例如“Open Sans Light 300 Italic”

谢谢

最佳答案

CSS

@import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,300,400,700);
        body {
            font-family: 'Open Sans', sans-serif;
        }

        body p {
            font-style: italic;
            font-weight: 300; /* You specify the number you see next to the fonts to change from light to bold ie you would put 700 etc. etc. */
        }

关于css - 导入和使用 google webfont,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19161854/

相关文章:

html - 在导航堆叠元素旁边放置字形图标

css - 如何在我的 ASP 应用程序中也包含 Bootstrap 字体目录?

html - 如何将 Google 字体 .ttf 文件转换为其他文件类型以支持所有浏览器

internet-explorer - IE 10和11上未显示蒙特塞拉特字体

css - 在 svg 中的样式标签上添加多个谷歌字体

css - 为什么这个 CSS 导航栏没有完全位于顶部?

css - 当我在其中放置文本时,DIV 会移动

css - $ 符号在 css 中意味着什么以及如何验证它?

jquery - 如何在 jQuery 中使用 css font-weight 属性为文本设置动画?正常到粗体

android - 以编程方式创建 TextView 后更改 TextView 字体