unable to load resource (icons) using .css file for JSF page [duplicate]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 20:32:31

问题


This is my icon.css file.

 @font-face {
font-family: 'icomoon';
src:url("#resource{['css/fonts/icomoon.eot']}");
src:url("#resource{['css/fonts/icomoon.eot?#iefix']}") format('embedded-opentype'),
    url("#resource{['css/fonts/icomoon.woff']}") format('woff'),
    url("#resource{['css/fonts/icomoon.ttf']}") format('truetype'),
    url("#resource{['css/fonts/icomoon.svg#icomoon']}") format('svg');
font-weight: normal;
font-style: normal;

}

I have used resource handler instead I need to use resource loader to call .eot , .woff files. because my icons are not displaying on my jsf page. I have googled about the same but couldn't find the solution. I would be thankful if anyone can help me.


回答1:


@font-face {
font-family: 'icomoon';
src: url("#{resource['Styles:fonts/icomoon.eot?gmqg4d']}");
src: url("#{resource['Styles:fonts/icomoon.eot']}&gmqg4d#iefix") format('embedded-opentype'),
url("#{resource['Styles:fonts/icomoon.ttf']}") format('truetype'),
url("#{resource['Styles:fonts/icomoon.woff']}") format('woff'),
url("#{resource['Styles:fonts/icomoon.svg']}&gmqg4d#icomoon") format('svg'); 
font-weight: normal;
font-style: normal;
}

Here the code. Look, if it does not work, restart the server as many times as necessary until the icons appear



来源:https://stackoverflow.com/questions/28645503/unable-to-load-resource-icons-using-css-file-for-jsf-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!