有没有办法删除此自定义字体的字体粗细?

Is there a way to remove the font weight on this custom font?

你好,我刚从 https://fonts.google.com 导入了这个字体,我似乎无法删除字体粗细设置,我试过从 URL 中删除粗细的东西,但没有任何帮助

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap');

可以使用cssfont-weight属性。 检查这个 https://www.w3schools.com/cssref/pr_font_weight.asp

对于每个权重,您必须加载其自己的字体。在你的问题中是

<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@200;300&display=swap" rel="stylesheet">

这将加载 2 种字体,重量分别为 200 和 300。之后,您可以在自定义样式中使用它,例如

h2 {
  font-family: Montserrat, sans-serif;
  font-weight: 200;
}