我已经使用了 Google Fonts 中关于如何设置字体的建议。所以我做了以下动作:
1)在页面添加此依赖:
<link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700&subset=cyrillic-ext" rel="stylesheet">
2)将CSS设置为body标签:
html, body {
font-family: 'Roboto', sans-serif;
background: #f7f7f7;
}
当我尝试为其他元素设置字体时,例如:
a {
font-family: Roboto-Light;
}
这是行不通的。
a {
font-family: 'Roboto'; /* You don't need this since you say html {font-family: 'Roboto'}*/
font-weight: 100;
}
/*Font's family name need to be inside quotes "MyFontName"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)