Icefaces 的默认外观以及如何自定义它
我有一个关于 Icefaces 造型的问题。 我有一个可以使用 Icefaces 组件的最小应用程序,但是当我使用它们并查看页面时,组件没有样式(例如按钮具有默认外观,选项卡根本没有外观,没有图像,什么都没有)。 我想知道这是为什么,以及我应该做什么才能让默认的 Icefaces 外观发挥作用。
接下来我不明白的是如何通过更改一些自动应用于组件的默认 css 样式类来自定义外观,因此我使用的每个组件都会获得更改后的样式。
谢谢您的回答!
I have a question about styling Icefaces. I have a minimal application that can use Icefaces components, but when I use them and view the page, the components are not styled (for example the buttons have the default look and tabs have no look at all, no images, nothing). I was wondering why that is and what I should do so I would get the default Icefaces look to work.
Next thing I don't get is how do I customize the look by changing some default css style classes that get applied to the components automatically, so every component I use gets the changed style.
Thank you for your answers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议您采用 ICEfaces 包中包含的现有样式表之一(检查下载的 ICEfaces-1.8.1-bin.zip 的resources文件夹):
You可以在 ICEfaces 展示中预览它们
将其包含在您的 *.xhtml 文件中通过
标签:从这里开始,您可以随意操作所选的样式表,或者 - 我喜欢 - 在 ICEfaces 的样式表之后包含您自己的样式表并覆盖所需的样式。
关于你的第二个问题:
基本上每个 ICEfaces 组件都有自己的样式类。 只需浏览展示并使用 Firebug 检查组件即可。 我还没有找到很多在不同组件之间重用的类。 因此,您必须自己自定义每个组件 - 或者通过 styleClass 属性将您自己的通用样式类应用到您使用的每个组件。
I suggest that you take one of the existing style-sheets, which are included within the ICEfaces package (check the resources folder of the downloaded ICEfaces-1.8.1-bin.zip):
You can preview them in the ICEfaces showcase
Include it within your *.xhtml file via the
<ice:outputStyle>
tag:Starting from here, feel free to either manipulate the chosen stylesheets or - which I favor - include your own stylesheets after ICEfaces' ones and overwrite the needed styles.
Regarding your second question:
Basically every ICEfaces component has its own style class. Just browse around the showcase and inspect the components with Firebug. I've not found many classes, which have been reused between different components. Therefore, you'll have to customize each and every component on your own - or apply your own common style class to every component you use via the styleClass property.