【问题标题】:How to render Open Sans Semibold in firefox without using font weight property如何在不使用字体粗细属性的情况下在 Firefox 中渲染 Open Sans Semibold
【发布时间】:2017-07-18 02:20:56
【问题描述】:

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

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

【问题讨论】:

标签: html css google-chrome firefox fonts


【解决方案1】:

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

例子:

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

希望这有效..

【讨论】:

  • 是的,工作正常。但是是否可以通过在字体系列中指定 Open Sans Semibold 来做到这一点?谷歌浏览器可以正确呈现它。
  • 我认为你不能使用 font-family 属性来指定firefox的字体粗细。使用 font-weight 代替,因为它的工作是用来指定字体的重量。
【解决方案2】:

试试这个

body{font-family:"Open Sans"}
h1{font-weight:400}
h2{font-weight:600}
h3{font-weight:700}
<html>
<head>
	<title></title>
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">
</head>
<body>
  <h1>Test one</h1>
  <h2>Test two</h2>
  <h3>Test three</h3>
</body>
</html>

【讨论】:

    猜你喜欢
    • 2017-12-20
    • 2013-10-17
    • 2016-12-29
    • 2017-01-13
    • 2014-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多