Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 CSS 文件中,我想 @import 谷歌字体的所有权重和样式,比如 Roboto 或 Roboto Slab,以进行实验。稍后我可以修剪到仅需要样式的列表。有没有捷径,而不是将整个列表放在@import 中?
可惜没办法,需要一一导入。您可以尝试通过媒体链接导入字体,在字体名称后设置所需的权重,如下所示:
<link href="https://fonts.googleapis.com/css?family=Khula:400,600,700" rel="stylesheet">
注意:网络字体确实会减慢您的网站速度,请尝试仅导入需要的字体。