我将 PrimeFaces 1.1 与 JSF 1.2 结合使用。
我需要更改 PrimeFaces 的样式 <p:lightBox>
具有蓝色黑色边框的叠加层,但 style
组件的属性不会更改叠加层,只会更改调用灯箱的链接。
<p:lightBox width="50%" height="25%"
style="border: 5px; border-style: solid; border-color: blue;">
<h:outputLink value="#" title="Leo Messi" >
<h:outputText value="The Messiah"/>
</h:outputLink>
<f:facet name="inline">
<h:panelGrid columns="2">
<p:graphicImage value="/images/barca/messi.jpg" />
<h:outputText style="color:#FFFFFF"
value="Messi is an unusual player. He is highly creative, and has the skills to take on defenders with ease. He is a versatile left-footed player who can play either in the middle or on either wing, or even as a centre forward.
Although he is quite short, he is so fast and physically strong that he can cope with larger opponents. He is incredibly powerful, and a specialist in such dead ball situations as corners, free kicks and penalties.
Leo Messi is cool-headed and able to assume several responsibilities in times of need. He is a player who is destined to have a very successful career in football."></h:outputText>
</h:panelGrid>
</f:facet>
</p:lightBox>
最佳答案
如果我没记错那就是<a>
标签生成。我不知道你是否可以为 lightbox 的 <div>
添加任何属性.
我没有生成你的 HTML 代码,但你可以这样做:
- 使用谷歌浏览器检查灯箱(右键单击灯箱并检查元素)以查看
<div>
的类(class)。 - 为
<a>
添加一个新的“onclick”属性并使用 javascript 重新设计元素的样式...
但是你应该从 jar 文件中修改 primefaces 的 css...我不觉得 javascript 方法很优雅...
关于css - 更改 LightBox Primefaces 的样式边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7977715/