【问题标题】:Using a font-face embedded font as hyperlink does not work使用字体嵌入字体作为超链接不起作用
【发布时间】:2016-03-24 04:58:01
【问题描述】:

在网站上使用 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;

}

有什么建议吗?

【问题讨论】:

    标签: css hyperlink font-face


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2015-01-19
      • 1970-01-01
      • 2012-10-21
      • 1970-01-01
      • 1970-01-01
      • 2013-05-25
      • 1970-01-01
      • 1970-01-01
      • 2015-07-26
      相关资源
      最近更新 更多