如何使用 Google 的字体更改 Bootstrap 默认字体系列? [英] How can I change the Bootstrap default font family using font from Google?
本文介绍了如何使用 Google 的字体更改 Bootstrap 默认字体系列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在创建一个博客站点,我想更改 Bootstrap 字体.在标题中的导入 CSS 中,我添加了此字体
I am creating a blog site and I want to change the Bootstrap font. In my import CSS in header I added this font
<link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'>
如何将其用作引导程序默认字体?
How can I use this as my bootstrap default font?
推荐答案
首先,你不能以这种方式将字体导入 CSS.
First of all, you can't import fonts to CSS that way.
您可以在 HTML 头中添加此代码:
You can add this code in HTML head:
<link href='http://fonts.googleapis.com/css?family=Oswald:400,300,700' rel='stylesheet' type='text/css'>
或者像这样将其导入到 CSS 文件中:
or to import it in CSS file like this:
@import url("http://fonts.googleapis.com/css?family=Oswald:400,300,700");
然后,在您的 css 中,您可以编辑正文的字体系列:
Then, in your css, you can edit the body's font-family:
body {
font-family: 'Oswald', sans-serif !important;
}
这篇关于如何使用 Google 的字体更改 Bootstrap 默认字体系列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文