gpt4 book ai didi

css - @font-face 在使用 src : url(data:font) 时不通过 h​​ttps 加载

转载 作者:行者123 更新时间:2023-11-28 01:18:52 24 4
gpt4 key购买 nike

通过这种方法在 CSS 中定义字体样式时,如何强制 URL 使用 https?

@font-face {
font-family: "font-name";
src: url(data:font/truetype;base64,AAEEEEAXX........);
font-style: normal;
}

最佳答案

使用 data:font/trueType,您没有加载任何文件。您不能设置任何协议(protocol)。

来自 MDN:

Data URLs are treated as unique opaque origins by modern browsers, rather than inheriting the origin of the settings object responsible for the navigation.

关于css - @font-face 在使用 src : url(data:font) 时不通过 h​​ttps 加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51639817/

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