作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在网站上使用 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/
我是一名优秀的程序员,十分优秀!