使用谷歌网络字体,我无法获得字体粗细来产生结果。这三个权重确实有名称,但没有在 href 链接中指定,所以我不确定是否需要添加名称。
这是那部分代码:
<link href='http://fonts.googleapis.com/css?family=Quicksand:400,300,700' rel='stylesheet' type='text/css'><style type="text/css">
body{
background-color: white;
margin-left: 20%;
margin-right: 20%;
border: none;
padding: 10px 10px 10px 10px;
font-family: Quicksand, sans-serif;
font-weight: 300;
}
最佳答案
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500&display=swap" rel="stylesheet">
:- 在链接任何类型的外部字体之前使用预连接关系,现在它可以工作,如果有任何问题然后告诉我
关于css - 字体粗细在CSS中没有改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16072265/