从CSS文件加载字体文件

时间:2016-04-01 21:41:21

标签: jsf jsf-2.2

我试图从CSS文件中运行字体文件:

此代码工作正常:

  src: url("../fonts/fontawesome-webfont.eot?#iefix&v=4.5.0") format("embedded-opentype"), url("../fonts/fontawesome-webfont.woff2?v=4.5.0") format("woff2"), url("../fonts/fontawesome-webfont.woff?v=4.5.0") format("woff"), url("../fonts/fontawesome-webfont.ttf?v=4.5.0") format("truetype"), url("../fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular") format("svg");

但是这段代码不起作用:

  src: url("#{resource['fonts/fontawesome-webfont.eot?#iefix&v=4.5.0']}") format("embedded-opentype"), url("#{resource['fonts/fontawesome-webfont.woff2?v=4.5.0']}") format("woff2"), url("#{resource['fonts/fontawesome-webfont.woff?v=4.5.0']}") format("woff"), url("#{resource['fonts/fontawesome-webfont.ttf?v=4.5.0']}") format("truetype"), url("#{resource['fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular']}") format("svg");

加载字体文件的正确方法是什么?

0 个答案:

没有答案