【问题标题】:How can i solve font-weight, text too bold, in safari or mac when compared to other browsers?与其他浏览器相比,我如何在 safari 或 mac 中解决字体粗细、文本太粗的问题?
【发布时间】:2016-06-21 21:58:17
【问题描述】:

我在我的网站中使用了“Levenim MT”字体。 Mozilla Firefox、Google Chrome 和其他相关浏览器是正确的。但是 MAC 和 Safari 浏览器的字体大小和重量对任何其他浏览器来说都太大了。现在我该怎么办?

@font-face {
  font-family: 'levenim_mt';
  src: url('../fonts/levenim_mt.eot');
  src: url('../fonts/levenim_mt.eot?#iefix') format('embedded-opentype'),
       url('../fonts/levenim_mt.woff') format('woff'),
       url('../fonts/levenim_mt.ttf') format('truetype');

}

body{
  font-family: 'levenim_mt', sans-serif;
  background: #f4f4f4;
  clear: both;
}

我的网站在:enter link description here

【问题讨论】:

    标签: javascript html css macos safari


    【解决方案1】:

    这个错误对我来说是新的和独特的,但我知道有 1 个 css hack,通过它你可以专门为 mac 编写 css

    if(navigator.userAgent.indexOf('Mac') > 0)
    $('body').addClass('mac-os');
    
    body.mac-os{
      font-family: 'levenim_mt', sans-serif;
      background: #f4f4f4;
      clear: both;
      font-weight: //font weight for mac you want;
      font-size: //font size for mac you want;
    }
    

    这仅适用于 mac 中的 css 之上

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-23
      • 2014-07-16
      • 2011-02-02
      • 1970-01-01
      • 2014-02-12
      • 2015-09-16
      • 2021-10-18
      相关资源
      最近更新 更多