如何覆盖 PrimeFaces 的样式表? [英] How to override stylesheets of PrimeFaces?
问题描述
我只是尝试通过 FireBug 在生成的 HTML 中查看组件的名称,然后我在 JSF 项目中手动定义的 css 中更改它,但无法覆盖 PrimeFaces 的 CSS 定义.提前感谢您的任何想法.
Simply i tried to look the name of a component in generated HTML through FireBug after that i change it in my manually defined css in JSF project, but could not override the PrimeFaces' CSS definition. Thanks in advance for any idea.
推荐答案
如果使用 primefaces 2.2.1,请使用 h:outputStylesheet 标签并将其包含在 h:body 中而不是 h:head 中以覆盖 primefaces 样式表,与 h 相同:outputScript.
If using primefaces 2.2.1, Use the h:outputStylesheet tag and include it in h:body not in h:head to override primefaces stylesheets, same with h:outputScript.
示例:
<h:body>
<h:outputStylesheet library="css" name="YOURSTYLES.css" />
<h:outputScript library="javascript" name="YOURSCRIPT.js" target="head" />
</h:body>
如果使用 primefaces 3,请关注此博客条目https://www.primefaces.org/resource-rendering/
If using primefaces 3, follow this blog entry https://www.primefaces.org/resource-rendering/
这篇关于如何覆盖 PrimeFaces 的样式表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!