gpt4 book ai didi

css - 在 css 中链接字体文件在 firefox 中不起作用(但在所有其他浏览器中都有效)

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

我有以下代码:

#entrance {
margin: 20% auto auto auto;
text-align: center;
font-family: 'Baron Neue';
src: url('fonts/baron.otf');
}

这允许文本在 chrome 中以所需的字体呈现,即 safari 和 opera,但不是 firefox。我得到的只是 times new roman。

最佳答案

使用@font-face 属性。

@font-face {  
font-family: Baron Neue;
src: local('Baron Neue'),
url('fonts/baron.otf');
font-weight: 400;
}

参见 http://sixrevisions.com/css/font-face-guide/

关于css - 在 css 中链接字体文件在 firefox 中不起作用(但在所有其他浏览器中都有效),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18419273/

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