CSS 自定义字体:<b> 有效但 font-weight:bold 无效
CSS custom font: <b> works but font-weight:bold does not
您好,我在 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;}
您好,我在 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;}