【问题标题】:What does # means in SVG's format in CSS' @font-face rule [duplicate]#在CSS'@font-face规则中的SVG格式中是什么意思[重复]
【发布时间】:2015-08-29 00:23:39
【问题描述】:

问题 1:在使用 SVG 格式时,字体规则中的# 是什么意思? 几乎每个人都使用它,但我不明白这是什么意思。

问题 2:自从 Internet Explorer 6 被删除后,#iefix 是否仍然需要它?

@font-face {
    font-family: 'Font';
    src: url('css/fonts/Font.eot');
    src: url('css/fonts/Font.eot?#iefix') format('embedded-opentype'),
         url('css/fonts/Font.woff') format('woff'),
         url('css/fonts/Font.ttf') format('truetype'),
         url('css/fonts/Font.svg#SOME_RANDOM_STUFF_HERE') format('svg');
         font-weight: 100;
}

【问题讨论】:

  • 您的问题似乎有一个悬而未决的“The”。
  • 谢谢@NicoO 我进行了搜索,但没有找到答案。现在我知道我可以为我的所有字体创建一个 SVG 文件。减少我的整体 HTTP GET。

标签: html css svg


【解决方案1】:

这与旧版 IE 解释字体声明的方式有关。如果您不添加 #iefix,您将遇到 IE8 及之前版本的问题。

【讨论】:

  • 但是对于 IE9++,需要这个吗?我只支持IE9/10/11
猜你喜欢
  • 2011-04-11
  • 2015-12-04
  • 2019-09-27
  • 2011-06-19
  • 2017-07-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-05
相关资源
最近更新 更多