html - 调试 Google Web 字体

标签 html css font-face

我想我正在使用与 b4 类似的代码,但似乎没有加载字体

<html>
    <head>
        <script src="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:extralight,light,regular,bold"></script>
        <style>
        h1, h2, h3 { font-family: "Yanone Kaffeesatz"; color: red } 
        </style>
    </head>
    <body>
        <h1>This is some text</h1>
    </body>
</html>

最佳答案

您需要使用 <link> 包含字体标签。

<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:extralight,light,regular,bold">

关于html - 调试 Google Web 字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3253064/

相关文章:

android - Html.fromHtml 函数的 "font"标记中有哪些字体可用?

php - 我如何使用 name 属性而不是 TinyMCE 的 ID 来发布

html - TypeError:current.play不是React中的函数

html - 3 列布局,中间列内有 1 列 + RWD

javascript - 如何告诉样式标签从类中获取属性?

html - 为什么这个词在网页中显示为大写?

html - 将旋转文本锚定到父元素的上限

css - 在 .net 中动态更改 less 变量

css - IE9 无法识别字体粗细 : lighter

html - chrome 中的@font-face 未捕获的语法错误