gpt4 book ai didi

css - 上传到不同服务器后网站字体停止工作

转载 作者:行者123 更新时间:2023-11-28 06:35:02 25 4
gpt4 key购买 nike

我最近为我的客户建立了一个网站,但遇到了问题。当我上传到我的服务器 (apache) 时一切正常,但是当我的客户将它上传到他的服务器时(我还不知道是什么操作系统),字体停止正常工作。相同的文件,相同的代码,与浏览器无关。有任何想法吗?

@font-face {
font-family: 'xxx';
src: url('xxx.eot');
src: url('xxx.eot?‪#‎iefix‬') format('embedded-opentype'),
url('xxx.woff') format('woff'),
url('xxx.ttf') format('truetype'),
url('xxx.svg#xxx') format('svg');
font-weight: normal;
font-style: normal;
}

最佳答案

我想我发现了你的问题:http://trzydewizje.com/ud/font/ .

trzydewizje.com/ud/font/SegoeCondensed.woff Failed to load resource: the server responded with a status of 404 (Not Found)

trzydewizje.com/ud/font/SegoeCondensed.ttf Failed to load resource: the server responded with a status of 404 (Not Found)

Errors

至少在您在评论中发布的错误中,您试图链接到 SegoeCondensed.woff,而实际文件都是小写的,如 segoecondensed.woff

为了验证这一点,我访问了添加字体的样式表(http://trzydewizje.com/ud/font/stylesheet.css),这似乎是问题所在:

@font-face {
font-family: 'Segoe Condensed';
src: url('SegoeCondensed.eot');
src: url('SegoeCondensed.eot?#iefix') format('embedded-opentype'),
url('SegoeCondensed.woff') format('woff'),
url('SegoeCondensed.ttf') format('truetype'),
url('SegoeCondensed.svg#SegoeCondensed') format('svg');
font-weight: normal;
font-style: normal;
}

我通过在浏览器中编辑 css 进行了检查,更改文件名解决了您的问题:

@font-face {
font-family: 'Segoe Condensed';
src: url('segoecondensed.eot');
src: url('segoecondensed.eot?#iefix') format('embedded-opentype'),
url('segoecondensed.woff') format('woff'),
url('segoecondensed.ttf') format('truetype'),
url('segoecondensed.svg#SegoeCondensed') format('svg');
font-weight: normal;
font-style: normal;
}

关于css - 上传到不同服务器后网站字体停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34752927/

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