yah*_*ahh 3 css jsf fonts primefaces
主要的5.2
我不能得到字体真棒使用primefaces,我已经在web.xml文件中设置了上下文参数
<context-param>
<param-name>primefaces.FONT_AWESOME</param-name>
<param-value>true</param-value>
</context-param>
Run Code Online (Sandbox Code Playgroud)
我试着像这样使用它
<p:commandButton value="Capture" icon="fa fa-camera-retro"/>
<p:commandButton value="Edit" icon="fa fa-edit" type="button"/>
Run Code Online (Sandbox Code Playgroud)
但不是向我显示它显示^的图标,我在这里看到了类似的帖子,并尝试通过在css中包含以下内容发布的建议
.ui-icon.fa {
text-indent:0px;
background-image:none;}
Run Code Online (Sandbox Code Playgroud)
和
.ui-icon {
text-indent: 0;}
Run Code Online (Sandbox Code Playgroud)
但他们都没有为我工作.我不确定我是否错过了一步,我没有包括css或jar字体真棒,因为我很确定它内置于primefaces 5.2
显然我必须在web.xml文件中添加mime-type.这并没有在任何文档中提到过.答案来自以下链接
这就是我添加的内容
<mime-mapping>
<extension>eot</extension>
<mime-type>application/vnd.ms-fontobject</mime-type>
</mime-mapping>
<mime-mapping>
<extension>otf</extension>
<mime-type>font/opentype</mime-type>
</mime-mapping>
<mime-mapping>
<extension>ttf</extension>
<mime-type>application/x-font-ttf</mime-type>
</mime-mapping>
<mime-mapping>
<extension>woff</extension>
<mime-type>application/x-font-woff</mime-type>
</mime-mapping>
<mime-mapping>
<extension>svg</extension>
<mime-type>image/svg+xml</mime-type>
</mime-mapping>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13665 次 |
| 最近记录: |