【发布时间】:2020-03-31 23:02:46
【问题描述】:
我正在使用 ATOM,我尝试在我的代码中从 google 字体更改字体系列,但有些东西没有改变。
首先我这样做:href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet" type="text/css"
【问题讨论】:
-
你能完成你的描述吗?
我正在使用 ATOM,我尝试在我的代码中从 google 字体更改字体系列,但有些东西没有改变。
首先我这样做:href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet" type="text/css"
【问题讨论】:
好的,有几种方法可以导入谷歌字体
1: 在 html>head
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
然后在css中
body{
font-family: 'Roboto', sans-serif;
}
2:
在css文件中
@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');
然后
然后在css中
body{
font-family: 'Roboto', sans-serif;
}
【讨论】: