有没有办法将google字体添加到内部css中?就像配置文件布局一样?
我试着把这三个都嵌入进去,但是我不能让它改变我布局中字体的外观。google字体适用于内部css还是仅适用于外部css?
<style>
<link href='http://fonts.googleapis.com/css?family=Dancing+Script' rel='stylesheet' type='text/css'>
@import url(http://fonts.googleapis.com/css?family=Dancing+Script);
</style>发布于 2015-07-28 04:43:41
Google字体链接需要嵌入到HTML或XHTML文档的head元素中。需要理解的是,Google字体是通过内容分发网络(CDN)处理的。这意味着Google会为你托管字体。
下面是他们网站上的一个例子:
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine">
<style>
body {
font-family: 'Tangerine', serif;
font-size: 48px;
}
</style>
</head>
<body>
<div>Making the Web Beautiful!</div>
</body>
</html>您可以在外部样式表中引用Google字体,而不是在内部引用,如下所示。
https://stackoverflow.com/questions/28669258
复制相似问题