0

i want to design a jsf page with css using file style.css . it doesn't work for me . this is jsf which i want to design the component command button with the id="login"

    <h:head>
        <meta charset="UTF-8"></meta>
        <title>gidee</title>
    </h:head>

    <ui:define name="metadata">
    </ui:define>
    <ui:define name="content">
        <f:view>
        <div id="div1">
                    <H4>Connexion</H4>
                <h:outputStylesheet library="css" name="style.css"  />               
            <h:panelGrid styleClass="panelGridCenter" columns="1" cellpadding="5">


                <p:inputText id="email" name="email" label="email" 
                    placeholder="email" required="true" value="#{loginBean.email}" requiredMessage="le champ username est obligatoire"/>


                <p:password id="password" name="pw" label="Mot de passe" 
            placeholder="mot de passe"  required="true"  value="#{loginBean.password}" requiredMessage="le champ mot de passe est obligatoire"/>
                    <p:commandButton id = "login" value="Login" action ="#{loginBean.login}" >
                    </p:commandButton>
                <f:facet name="footer">
                </f:facet>
            </h:panelGrid>
        </div>
 </f:view>
    </ui:define>
</ui:composition>

and the style.css

 #login{
        background: #3966CE !important;   border: 0;
      padding: 15px;
      color: #FFFFFF;
      font-size: 14px;
      -webkit-transition: all 0.3 ease;
      transition: all 0.3 ease;
      cursor: pointer; width: 100%; 

    }
5
  • Have you included style.css at the place where you are using the above component? Commented Jun 1, 2017 at 12:07
  • style.css is under resources folder Commented Jun 1, 2017 at 12:11
  • But have you included that css file in the page using <link> tag? Commented Jun 1, 2017 at 12:12
  • i included the css file using <h:outputStylesheet> tag Commented Jun 1, 2017 at 12:15
  • In your browser, rightclick page and choose View Source to see the JSF-generated HTML output. That's exactly what CSS (and JavaScript and all other client side things) is actually seeing. Commented Jun 1, 2017 at 12:27

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.