【问题标题】:JSF Tag disables css preferences for Log Out buttonJSF 标记禁用注销按钮的 css 首选项
【发布时间】:2017-07-11 19:04:59
【问题描述】:
<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 首选项?

  • 【问题讨论】:

    • 你试过我的建议了吗?

    标签: javascript html css jsf


    【解决方案1】:

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

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-06-04
      • 2011-03-12
      • 1970-01-01
      • 2017-01-18
      • 2011-10-18
      • 2023-03-30
      • 1970-01-01
      相关资源
      最近更新 更多