JSF标记禁用“注销”按钮

时间:2017-02-21 22:50:34

标签: javascript html css jsf

<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首选项

  • Logout Button with Tag

    当我删除JSF标签时,Logout按钮看起来很正常。为什么JSF标签会禁用CSS首选项?

  • 1 个答案:

    答案 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 */
    }
    

    参考文献:

    1. TutorialsPoint reference

    2. This thread here

    3. 希望这有帮助