html - 如何在不使用字体粗细属性的情况下在 Firefox 中呈现 Open Sans Semibold

标签 html css google-chrome firefox fonts

Firefox 未正确呈现 Open Sans 半粗体。但是 Chrome 中的相同代码呈现字体。字体安装在我的系统中。是否可以在不使用字体粗细属性的情况下呈现它?

<html>
<style>
p{
font-family:"Open Sans Semibold"; }
</style>
<body>
<p >test</p>
</body>
</html>

最佳答案

如果已安装字体,则在 font-weight 中传递值为 600 而不是在 font-family 属性中指定。

例子:

p {
font-family: 'Open Sans',sans-serif;
font-weight:600;
}

希望这能奏效..

关于html - 如何在不使用字体粗细属性的情况下在 Firefox 中呈现 Open Sans Semibold,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42486284/

相关文章:

html - css margin-top 压低了我的页脚

jquery - 悬停时增加和减少列表中 block 的宽度和高度

html - Chrome 渲染大小为小数,Firefox 为整数

css - 更改 Chrome 自动完成的输入背景

javascript - Chrome 83 : Cannot upload file

javascript - 提交时如何使单选字段确定下一页

html - 为什么我的div旁边有href装饰?

html - 响应式背景图像社交图标

javascript - 检测 CSS 文件何时完成开关

javascript - Chrome 扩展程序通过 tabId 进行 WebRequest 过滤不起作用?