gpt4 book ai didi

css - 如何将谷歌字体连接到页面?

转载 作者:太空宇宙 更新时间:2023-11-03 21:11:02 25 4
gpt4 key购买 nike

我已经使用了 Google Fonts 中关于如何设置字体的建议。所以我做了以下操作:

1) 在页面添加了这个附件:

<link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700&amp;subset=cyrillic-ext" rel="stylesheet">

2) 将 CSS 设置为 body 标签:

 html, body {
font-family: 'Roboto', sans-serif;
background: #f7f7f7;
}

当我尝试为其他元素设置字体时,例如:

a {
font-family: Roboto-Light;
}

它不起作用。

enter image description here

最佳答案

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"

关于css - 如何将谷歌字体连接到页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46984673/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com