【发布时间】:2015-07-10 01:47:00
【问题描述】:
我正在尝试嵌入字体,就像我对 FontSquirrel 生成的 CSS 所做的那样,只是使用相对路径:
@font-face {
font-family: 'MyFontFamily';
src: url('config/templates/fonts/MyFont.eot');
src: url('config/templates/fonts/MyFont.eot?#iefix') format('embedded-opentype'),
url('config/templates/fonts/MyFont.woff') format('woff'),
url('config/templates/fonts/MyFont.ttf') format('truetype'),
url('config/templates/fonts/MyFont.svg#MyFont') format('svg');
font-weight: normal;
font-style: normal;
}
这似乎不起作用。
将其更改为/base/config/templates/fonts... 可以解决问题,但为了应用程序,最好使用相对路径。
字体文件确实相对于使用它们的文档存在。
字体导入的相对路径是不可接受的吗?这是怎么回事?
【问题讨论】: