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