CSS 如何设置 Bootstrap @font-family-base?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18153794/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 23:53:52  来源:igfitidea点击:

How to set Bootstrap @font-family-base?

csstwitter-bootstraplessfont-face

提问by cja

Bootstrap docssay:

Bootstrap 文档说:

Use the @font-family-base, @font-size-base, and @line-height-baseattributes as our typographic base.

使用@font-family-base@font-size-base@line-height-base属性作为我们的印刷基地。

Does this mean there is a CSS variable called @font-family-base?

这是否意味着有一个名为 的 CSS 变量@font-family-base

How can I set this in CSS to change the font for my whole page?

如何在 CSS 中设置它以更改整个页面的字体?

采纳答案by amatellanes

Visit the Bootstrap docs on customization- you can change several variables in Typography section, for instance @sansFontFamily, @serifFontFamily, @monoFontFamily, @baseFontSize, etc

访问上定制引导文档-您可以在版式部分改变几个变量,例如@sansFontFamily@serifFontFamily@monoFontFamily@baseFontSize,等

回答by

For Bootstrap 3 open up your custom.css and

对于 Bootstrap 3 打开你的 custom.css 和

body,
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: "Ubuntu", Helvetica, Arial, sans-serif!important;
}

回答by Simone

It's not a CSS variable, it's a LESS variable.

它不是一个 CSS 变量,它是一个LESS 变量

You can find (and edit) them in variables.less.

您可以在variables.less.

回答by Dave

See below, place at the top of your CSS file.

见下文,放在 CSS 文件的顶部。

@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700);