custom-font - CSS 自定义字体 : <b> works but font-weight:bold does not

标签 custom-font css

你好,我在我的 CSS 中添加了一个自定义字体,如下所示:

@font-face {
    font-family: dosis;
    src: url(Dosis-Regular.otf);
    font-weight:normal;
}

@font-face {
    font-family: dosis;
    src: url(Dosis-SemiBold.otf);
    font-weight:bold;
}

它是这样工作的:

<b> This appears bold </b>

但不是这样的:

p{font-weight:bold;}  /* in CSS file */
<p> This does not appear bold </p> /* in HTML file */

您知道可能是什么问题吗?

最佳答案

它可能在其他地方被覆盖了。试试这个:

p{font-weight:bold !important;}

关于custom-font - CSS 自定义字体 : <b> works but font-weight:bold does not,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28842185/

相关文章:

ios - 在 iOS Swift 中将自定义字体设置为 UILabel

android - 在 Android 中将 res/font 中的自定义字体与 WebView 结合使用

html - 我需要修改表单上的字段显示吗?.. Ruby on Rails...RoR...

html - 具有线性渐变的背景图像

html - CSS 下拉菜单在 IE 和 Firefox 中不起作用

android - 如何在android中的对话框中更改字体?

android - 如何更改抽屉导航中列表的字体?

ios - 我的自定义字体未显示

javascript - 此 Bootstrap 按钮下拉菜单不起作用。但为什么?

html - 想要重叠 2 个 div,所以即使缩放窗口,它们也不会移动