我正在尝试使用 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/