我在.info文件中添加了样式表并粘贴在google字体的url中,但是在firebug中它只显示整个页面,表明它没有正确链接.如何在drupal 7中链接谷歌字体?
小智 15
将其添加到template.php文件(位于主题文件夹中)中:
function YOURTHEMENAME_preprocess_html(&$variables) {
drupal_add_css('http://fonts.googleapis.com/css?family=Raleway:400,100,700', array('type' => 'external'));
}
Run Code Online (Sandbox Code Playgroud)
(将YOURTHEMENAME替换为您主题的真实姓名).
然后在你的css文件中正确的css代码.就像是 :
body {
font-family: 'Raleway', sans-serif;
}
Run Code Online (Sandbox Code Playgroud)
只需使用贡献的Google Fonts 模块,您的生活就会变得更加轻松……它可以为您完成所有工作,并且已被多次证明有效。
| 归档时间: |
|
| 查看次数: |
6693 次 |
| 最近记录: |