gpt4 book ai didi

javascript - JSF 标签禁用注销按钮的 css 首选项

转载 作者:行者123 更新时间:2023-11-28 04:18:05 24 4
gpt4 key购买 nike

<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>

所以我的问题是,我刚刚在我的软件上实现了注销按钮的功能。但是,当我添加“h:form”时,按钮会变紧并且似乎忽略了

  • 的 CSS 首选项。 Logout Button with Tag

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

  • 最佳答案

    当您将 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

    希望对你有帮助

    关于javascript - JSF 标签禁用注销按钮的 css 首选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42379508/

    24 4 0