gpt4 book ai didi

css - @font-face 仅适用于 IE,不适用于 chrome

转载 作者:太空宇宙 更新时间:2023-11-04 09:06:53 25 4
gpt4 key购买 nike

目前我正在使用 bootstrap 开发我的第一个 hmtl 和 css 元素。到目前为止,一切进展顺利。但是现在我在向我的网页添加自定义字体时遇到了问题。我搜索了如何执行此操作,但 @font-face 并没有真正起作用。我的老师在类里面修复了它,所以我只是不知道他是如何完美地做到这一点的,所以他没有给出代码。我做了下一个:

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

font-weight: normal;
font-style: normal;
}

我看到 chrome 支持 woff,所以我不明白为什么它不能在 chrome 上运行,但它在 IE 上运行。我的 h1 看起来像这样:

h1
{
font-family: 'Impact Label';
}

欢迎任何帮助。网站链接是here

最佳答案

您在最后一个 src 属性后缺少分号。代码应为:

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

font-weight: normal;
font-style: normal;
}

关于css - @font-face 仅适用于 IE,不适用于 chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42394055/

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