Is the hash necessary in svg font-face declarations?

前端 未结 1 622
一个人的身影
一个人的身影 2021-01-01 14:00
@font-face
  font-family: \'AllerRegular\'
  src: url(\'/fonts/aller/aller_rg-webfont.eot\')
  src: url(\'/fonts/aller/aller_rg-webfont.eot?#iefix\') format(\'embedd         


        
1条回答
  •  迷失自我
    2021-01-01 14:52

    Yes, it is required. This article says:

    In the CSS code above, you can actually see that the SVG version needs an extra info, its ID, after the hashtag (#) in the file name declaration. If you don’t fill it it’s not working, so you need to find this information opening the SVG file in a TXT document or notepad and look for the following line, near the top of page.

    And this one says:

    With SVG fonts, they also need a #hashtag;

    The hashtag is simply a pointer to the ID of the font defined inside the SVG. If you don't include it, the whole SVG file will be loaded, including SVG headers that prevent the font from being recognized.

    0 讨论(0)
提交回复
热议问题