<li><h:form styleClass="logoutbuttonform"><h:commandLink action="#{loginController.logout}"><i class="fa fa-sign-out pull-right"></i>Log Out</h:commandLink></h:form></li>
所以我的问题是,我刚刚在我的软件上实现了Logout Button的功能。但是当我添加“h:form”时,按钮变得紧张,似乎忽略了CSS首选项
当我删除JSF标签时,Logout按钮看起来很正常。为什么JSF标签会禁用CSS首选项?
答案 0 :(得分:0)
当您向styleClass
添加commandLink
属性时(与在表单标记中一样)并在CSS中更改类的样式时,它应该可以正常工作
这样的事情:
<li>
<h:form styleClass="logoutbuttonform">
<h:commandLink action="#{loginController.logout}" styleClass="yourClass">
<i class="fa fa-sign-out pull-right"></i>
Log Out
</h:commandLink>
</h:form>
</li>
CSS:
.yourClass {
/* Your CSS */
}
参考文献:
希望这有帮助