【问题标题】:Bootstrap with font-weight: 500 looks "normal" on FirefoxBootstrap with font-weight: 500 在 Firefox 上看起来“正常”
【发布时间】:2022-09-27 23:45:51
【问题描述】:

我正在使用 Bootstrap 并设置一个元素以使用 font-weight: 500 使其在 Chrome 中看起来中等/半粗体,但在 Windows 上的 Firefox 中看起来是正常重量:

铬合金:

火狐:

我怎样才能让它在两个浏览器中看起来都是半粗体的?

    标签: css twitter-bootstrap fonts typography


    【解决方案1】:

    Bootstrap 在 Windows 上的无衬线字体是“Segoe UI”,它支持“正常”(400) 和“半粗体”(600) 粗细,但不支持“中等”(500) 粗细。在这种情况下,Chrome 向上舍入为“半粗体”,而 Firefox 向下舍入为“正常”。更改为 600 将在两种浏览器中实现半粗体。

    【讨论】:

      【解决方案2】:

      Bootstrap v5.2 有一个fw-semibold 类,可以轻松实现“修复”(设置font-weight: 600)。在通常以粗体显示的标题元素中特别有用,但 Firefox 会使它们变得规则。

      https://getbootstrap.com/docs/5.2/utilities/text/#font-weight-and-italics

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-01-22
        • 1970-01-01
        • 2013-06-29
        • 2012-02-10
        • 2021-06-12
        • 2022-12-21
        • 2014-07-29
        • 2018-03-17
        相关资源
        最近更新 更多