css - 使用 Bootstrap 渲染开放的无谷歌网络字体?

标签 css twitter-bootstrap google-webfonts

我正在尝试使用 google web fonts open sans 和 bootstrap。

我正在加载字体:

我有一个 site-specific.css 在 Bootstrap 后加载。我试过:

.body { font-family: 'Open Sans', sans-serif;}

还有:

.bootstrap-container *,    
.bootstrap-container body, 
.bootstrap-container td, 
.bootstrap-container tr, 
.bootstrap-container div, 
.bootstrap-container p, 
.bootstrap-container form, 
.bootstrap-container input, 
.bootstrap-container select, 
.bootstrap-container textarea, 
.bootstrap-container font {
font-family: 'Open Sans', sans-serif;
}

但似乎无论我使用什么类选择器,字体都不会呈现,而是继承 Bootstrap 字体。我不确定如何调试它。

最佳答案

如果您没有更改 Bootstrap 的核心文件,我会让您自己更轻松地使用它们的“自定义”功能。将您的字体名称放入并用新文件替换现有的 Bootstrap 文件后重新下载它。

您可以在此处对其进行自定义:

http://getbootstrap.com/customize/

这样做至少可以确保您不会遗漏任何东西...并且请避免使用上面建议的 !important(除非您真的需要) . 希望对您有所帮助?

关于css - 使用 Bootstrap 渲染开放的无谷歌网络字体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13825401/

相关文章:

javascript - jQuery 选择多个类但在当前实例上为其中一个类更改 .css

javascript - Bootstrap 选择器的链式下拉菜单不起作用

html - Bootstrap 导航栏折叠/切换菜单立即出现

javascript - Amcharts 仅显示有关调整大小事件的数据

firefox - IE 和 Firefox 网页字体渲染问题

css - 下载集合中的字体时如何实现谷歌字体?

html - 如何垂直对齐和拉伸(stretch) flexbox 元素的子元素?

javascript - 什么是使用 html-php 的母版页

html - 如何使文本在 HTML 页面中垂直和水平居中

css - 谷歌字体有哪些可用的字体粗细?