Safari font-weight issue , text too bold

前端 未结 5 2044
生来不讨喜
生来不讨喜 2020-12-29 23:48

When I apply a font-weight:bold style, the look of the font is too bold in Safari when compared to other browsers. I tried below css as suggested in some site b

5条回答
  •  半阙折子戏
    2020-12-30 00:44

    The -webkit solutions won't work for the strong issue for many google fonts, custom fonts and fonts that don't have preset values.

    The problem is that you need to specify the value of bold in the strong tags.

    This can be done by two ways:

    You can either include from Google Fonts or wherever your font is from in your header; it needs both the regular font and the bold font each should have a different font-weight number like 400 regular and 600 bold for example:

    
    

    Or use the aboves source code and paste into your own css like below:

    @font-face {
      font-family: 'XXX';
      font-style: normal;
      font-weight: 600;
      src: local('XXX SemiBold'), local('XXX-SemiBold'), 
      url...
    }
    

    Use whatever your font is instead of XXX.

    Then also in strong {font-weight:600;}

提交回复
热议问题