【问题标题】:font-family override in mac on elementor siteelementor网站上mac中的字体系列覆盖
【发布时间】:2019-12-07 19:54:42
【问题描述】:

我有使用 elementor 构建的 wordpress 网站, 而且我在mac中的字体系列有问题,它已更改为默认字体,并且不允许我覆盖此字体。

这个网站 https://attenmind.co.il

我尝试对 mac 做一个特定的 css 规则,但它不起作用

html[data-useragent*='Mac OS X'] {
  font-family: inherit;
}

html[data-useragent*='Mac OS X 10_10'] {
  font-family:inherit;
}
    @font-face {
  font-family: 'verdana';
  src: url('https://attenmind.co.il/wp-content/themes/oceanwp/assets/fonts/verdana/Verdana.eot'); /* IE9 Compat Modes */
  src: url('https://attenmind.co.il/wp-content/themes/oceanwp/assets/fonts/verdana/Verdana.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('https://attenmind.co.il/wp-content/themes/oceanwp/assets/fonts/verdana/Verdana.woff2') format('woff2'), /* Super Modern Browsers */
       url('https://attenmind.co.il/wp-content/themes/oceanwp/assets/fonts/verdana/Verdana.woff') format('woff'), /* Pretty Modern Browsers */
       url('https://attenmind.co.il/wp-content/themes/oceanwp/assets/fonts/verdana/Verdana.ttf')  format('truetype'), /* Safari, Android, iOS */
       url('https://attenmind.co.il/wp-content/themes/oceanwp/assets/fonts/verdana/Verdana.svg#svgFontName') format('svg'); /* Legacy iOS */
}

html,body{
    font-family: 'verdana', Helvetica, sans-serif !important;
}

我只是想让 po 防止 mac 覆盖字体系列..

谢谢大家的帮助。

【问题讨论】:

  • 请分享你的css实现。您如何加载字体并命名您尝试使用的字体。
  • @Soothran 我现在编辑我的代码
  • 删除字体名称中的引号。只使用 verdana 而不是 'verdana'

标签: css wordpress macos font-family elementor


【解决方案1】:

检查您正在使用的字体是否在目标计算机中可用,或者它是否以受支持的格式从外部加载到您的 CSS 中(例如,Safari 与 format('truetype') 配合良好)。

如果您在 CSS 中有以下内容:

font-family: Arial, Helvetica, sans-serif;

浏览器将首先使用“Arial”字体。如果字体不可用,它将回退到下一个(“Helvetica”),依此类推。如果没有可用的,将使用浏览器中的默认字体。

【讨论】:

  • @yosef-dadya 如果答案没有帮助,请尝试在jsbin.com 或类似服务中创建一个运行示例,或者指出您网站中的哪些字体和区域无法正常工作。
  • 我在 verdana 字体是问题的问题中编辑我的 cose,我加载的所有格式都正确,但它不工作
猜你喜欢
  • 1970-01-01
  • 2022-07-20
  • 2022-09-24
  • 1970-01-01
  • 2019-07-22
  • 1970-01-01
  • 2016-05-03
  • 2015-05-25
  • 1970-01-01
相关资源
最近更新 更多