@font-face font-family: 'AllerRegular' src: url('/fonts/aller/aller_rg-webfont.eot') src: url('/fonts/aller/aller_rg-webfont.eot?#iefix') format('embedded-opentype'),url('/fonts/aller/aller_rg-webfont.woff') format('woff'),url('/fonts/aller/aller_rg-webfont.ttf') format('truetype'),url('/fonts/aller/aller_rg-webfont.svg#AllerRegular') format('svg') font-weight: normal font-style: normal
在上面的示例中,我添加了这个字体的svg版本,但我不知道该ID是否正确。如果SVG中只有一个字体包含正确的id?
解决方法
是的,这是必需的。
This article说:
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.
而this one说:
With SVG fonts,they also need a #hashtag;