html - Google Font Family 不会改变

标签 html css bootstrap-4

我刚回到 webdev,因为我想制作一个简单的网页。我从 Bootstrap 开始并围绕它构建我的页面。我希望能够更改标题的字体系列,但它不起作用。代码如下。

<link href="https://fonts.googleapis.com/css?family=Chewy" rel="stylesheet" type="text/css">  

<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<title>BOOST YOUR CONFIDENCE</title>

<section class="sectionone">

    <h1 class="display-1">Confidence Boost</h1>

</section>

<section class="sectiontwo">

    <h2 class="display-4">
        We all need a confidence boost sometimes, click below!
    </h2>

</section>

最佳答案

你的 CSS 很适合我;我唯一注意到的是你错过了“。” css 类名称中的类标识符,如下所示:

.display-1 {
    font-family: 'Chewy', cursive;
}

这是一个 fiddle :

https://jsfiddle.net/w4z1fqpz/

关于html - Google Font Family 不会改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48569107/

相关文章:

javascript - 使用PHP将表数据保存为CSV格式

javascript - 如何在网站加载中为任何标签静音音频/视频?

html - 如何在特定 div 的完整背景上显示图像?

html - 将图像一个接一个地放置并保持响应

javascript - Logo 未出现在背景图片上的问题

javascript - 使用引导下拉子菜单

jquery - 如果容器具有特定元素,则更改容器的宽度

CSS高度调整

javascript - 如何在背景附件 :fixed applied?(视差效果)时阻止 Bootstrap 4 slider 图像在幻灯片上移动位置

html - 在 bootstrap 列中放置一个 div 将内容推送到新行