gpt4 book ai didi

CSS - Chrome/Safari 相同的字体粗细在上传到 Wordpress 时不适用

转载 作者:行者123 更新时间:2023-11-28 15:16:46 27 4
gpt4 key购买 nike

我有一个前端网站,我正在使用 HTML5 空白子主题将其上传到 Wordpress。一些悬停文本以及页脚中的字体粗细存在非常明显的差异,我在独立的前端版本中没有看到这一点。

示例 - 页脚

Wordpress

non-Wordpress

示例 - 悬停文本

Wordpress

Front-end

这就是我的风格 -

样式.css

@font-face {
font-family: 'GothamLight';
src: url('fonts/GothamLight.eot');
src: url('fonts/GothamLight.eot') format('embedded-opentype'),
url('fonts/GothamLight.woff2') format('woff2'),
url('fonts/GothamLight.woff') format('woff'),
url('fonts/GothamLight.ttf') format('truetype'),
url('fonts/GothamLight.otf') format('opentype'),
url('fonts/GothamLight.svg#GothamLight') format('svg');
font-weight: normal;
font-style: normal;

}

body {

font-family: 'GothamLight', sans-serif !important;
font-size: 16px !important;
font-weight: 500 !important;
-webkit-font-smoothing: subpixel-antialiased !important;

}

我已经在谷歌上搜索并寻找答案 - 我已经尝试了所有这些但似乎都没有用。有什么我想念的吗?

最佳答案

为您要使用的每种字体粗细指定一个字体:

@font-face {
font-family: 'GothamLight';
src: url('fonts/GothamLight.eot');
src: url('fonts/GothamLight.eot') format('embedded-opentype'),
url('fonts/GothamLight.woff2') format('woff2'),
url('fonts/GothamLight.woff') format('woff'),
url('fonts/GothamLight.ttf') format('truetype'),
url('fonts/GothamLight.otf') format('opentype'),
url('fonts/GothamLight.svg#GothamLight') format('svg');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'GothamLight';
src: url('path/to/weight500font');
src: url('path/to/weight500font') format('embedded-opentype'),
url('path/to/weight500font') format('woff2'),
url('path/to/weight500font') format('woff'),
url('path/to/weight500font') format('truetype'),
url('path/to/weight500font') format('opentype'),
url('path/to/weight500font') format('svg');
font-weight: 500;
font-style: normal;
}

关于CSS - Chrome/Safari 相同的字体粗细在上传到 Wordpress 时不适用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47012486/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com