当我选择所有h1,h2,h3时,Google字体无效

pan*_*the 1 html css google-fonts

我试图通过在我的CSS顶部选择所有标题标签和p标签,将几种Google字体导入我的HTML/CSS.例如:

h1 h2 h3 {
  font-family: 'Trade Winds', cursive;
}
Run Code Online (Sandbox Code Playgroud)

但这不起作用.我三重检查,我在文件中的任何地方都没有其他字体系列规则,所以它不会被我或任何其他链接文件覆盖.当我将它直接应用到其他一些规则时,它确实有效:

section {
        margin-top: 20px;
        padding: 15px;
        border-radius: 15px;
        box-shadow: 0 0 8px rgba(100, 100, 100, 0.78);
        grid-column: 2/3;
        display: grid;
        font-family: 'Trade Winds', cursive;
}
Run Code Online (Sandbox Code Playgroud)

但我显然不倾向于对每个相关规则集进行硬编码,因为这只是多余的.我错过了CSS标签选择器的工作方式吗?

Dej*_*n.S 6

你需要用逗号分隔你的h标签

h1 h2 h3 {
  font-family: 'Trade Winds', cursive;
}
Run Code Online (Sandbox Code Playgroud)

应该

h1, h2, h3 {
  font-family: 'Trade Winds', cursive;
}
Run Code Online (Sandbox Code Playgroud)