p:使用styleClass或style时,firemark中不会显示水印

时间:2016-01-04 13:50:15

标签: jsf firefox primefaces liferay

XHTML

<div class="ui-fluid">
    <p:panelGrid columns="1" columnClasses="ui-grid-col-4" layout="grid"
                 styleClass="ui-panelgrid-blank" style="margin-top: 10px;">

        <p:inputText id="firstName" value="#{Admin.firstName}"
            required="true"
                     styleClass="addStudent"
            label="firstName"
            validatorMessage="Please specify the student's firstname">
        </p:inputText>
        <p:watermark for="firstName" value="First Name" />

        <p:inputText id="lastName" value="#{Admin.lastName}"
            required="true" styleClass="addStudent"
            label="lastName"
            validatorMessage="Please specify the student's lastname">
        </p:inputText>
        <p:watermark for="lastName" value="Last Name (will also be username)" />

        <p:inputText id="email" value="#{Admin.email}"
            required="true" styleClass="addStudent"
            lable="email"
            validatorMessage="Please specify the student's email">
        </p:inputText>
        <p:watermark for="email" value="email" />


        <p:commandButton value="Add" icon="fa fa-user-plus" action="#{Admin.addStudent}"
                        styleClass="addButton" ajax="false" style="padding: 4px; margin-top: 15px;"/>
    </p:panelGrid>
</div>

CSS

.addStudent {
    border: 1px solid #EAEAEA !important;
    background: #EAEAEA !important;
    margin: 10px 0 !important;
    color: #444 !important;
    padding: 18px 0px 18px 10px !important;
    border-radius: 6px !important;
}

水印不会在firefox中显示,而是显示空的inputText。 只有删除了styleClass,才会显示水印。

我也尝试过style =“padding:18px 0px 18px 10px;”而不是styleClass,但仍然没有。

为什么会发生这种情况?

先谢谢!

0 个答案:

没有答案