在 HTML 页面中:
<h:outputStylesheet library="css" name="bootstrap/fonts/glyphicons-halflings-regular.eot"></h:outputStylesheet>
<h:outputStylesheet library="css" name="bootstrap/fonts/glyphicons-halflings-regular.svg"></h:outputStylesheet>
<h:outputStylesheet library="css" name="bootstrap/fonts/glyphicons-halflings-regular.ttf"></h:outputStylesheet>
<h:outputStylesheet library="css" name="bootstrap/fonts/glyphicons-halflings-regular.woff"></h:outputStylesheet>
<h:outputStylesheet library="css" name="bootstrap/fonts/glyphicons-halflings-regular.woff2"></h:outputStylesheet>
在 CSS 中(您可以在另一个 .css 文件中覆盖 @font-face 并且不要触摸 bootstrap.css):
@font-face {
font-family: 'Glyphicons Halflings';
src: url("#{resource['css:bootstrap/fonts/glyphicons-halflings-regular.eot']}");
src: url("#{resource['css:bootstrap/fonts/glyphicons-halflings-regular.eot']}?#iefix") format('embedded-opentype'),
url("#{resource['css:bootstrap/fonts/glyphicons-halflings-regular.woff']}") format('woff'),
url("#{resource['css:bootstrap/fonts/glyphicons-halflings-regular.ttf']}") format('truetype'),
url("#{resource['css:bootstrap/fonts/glyphicons-halflings-regular.svg']}#glyphicons_halflingsregular") format('svg');
}
一般使用:
#{resource['<resource name>']}
或者
#{resource['<library name>:<resource name>']}