gpt4 book ai didi

css - 使用 font-face 嵌入字体作为超链接不起作用

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

在网站上使用 Liberation 字体适用于标准文本。但是我也想将该字体用作我的文本链接字体,但使用以下代码它不会调用/使用该字体。

a:link {
color: #69f;
font-family: liberation_sansbold;
font-size: 18px;
font-style: normal;
font-weight: bolder;
font-variant: normal;
text-transform: uppercase;
text-decoration: none

}

这是我网站上的嵌入式字体(正如我所说,它适用于常规(非链接)文本)。

@font-face {
font-family: 'liberation_sansbold';
src: url('website.com/liberationsans-bold-webfont.eot');
src: url('website.com/liberationsans-bold-webfont.eot?#iefix') format('embedded-opentype'),
url('website.com/liberationsans-bold-webfont.woff2') format('woff2'),
url('website.com/liberationsans-bold-webfont.woff') format('woff'),
url('website.com/liberationsans-bold-webfont.ttf') format('truetype'),
url('website.com/liberationsans-bold-webfont.svg#liberation_sansbold') format('svg');
font-weight: normal;
font-style: normal;

有什么建议吗?

最佳答案

看看this answer -- 大多数浏览器似乎都限制了可以应用于某些伪类的样式。我链接到的答案适用于 :visited,但如果类似的限制适用于 :link,我也不会感到惊讶。尝试只设置 a 的样式,而不是 a:link -- 我猜您可能希望您的字体无论如何都用于所有类型的链接。

关于css - 使用 font-face 嵌入字体作为超链接不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36185692/

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