首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >更改页面中心的咆哮位置

更改页面中心的咆哮位置
EN

Stack Overflow用户
提问于 2017-06-30 18:58:54
回答 1查看 3.5K关注 0票数 1

我使用的是jsf2.2primefaces 6.0,并且我已经实现了一个带有咆哮的登录接口来显示身份验证的失败。现在的问题是,我想要在网页的中心显示咆哮,而不是右上角,以获得更好的人体工程学结果。

xhtml代码:

代码语言:javascript
复制
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:f="http://xmlns.jcp.org/jsf/core"
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
    xmlns:jsf="http://xmlns.jcp.org/jsf"
    xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
    xmlns:p="http://primefaces.org/ui"
    template="/facelets/templateLogin.xhtml">
    <ui:define name="pageTitle">Please login ...</ui:define>
    <ui:define name="content">


        <div id="login-box" class="login-box visible widget-box no-border">
            <div class="widget-body">

                <div class="widget-main">

                    <h4 class="header blue lighter bigger">




                        <i class="fa fa-sign-in"></i> Entrer vos informations
                    </h4>

                    <div class="space-6"></div>

                    <div class="space-6"></div>
                    <div class="space-6"></div>

                    <h:form id="loginFormId">
                        <h:panelGrid id="grid"  cellpadding="5">
                        <p:growl id="growl" showDetail="true" sticky="true" />

                            <fieldset>
                                <label class="block clearfix"> <span
                                    class="block input-icon input-icon-right" > <p:inputText title="Entrer votre matricule"
                                            id="Matricule" value="#{identity.user.matricule}" required="true"
                                            class="form-control" pt:placeholder="Matricule" /><i
                                        class="ace-icon fa fa-user" /> <p:message for="Matricule" display="tooltip" />
                                </span>
                                </label> <label class="block clearfix" id="labelPassword"> <span
                                    class="block input-icon input-icon-right"> <p:password title="Entrer votre mot de passe"
                                            id="password" pt:placeholder="Mot de passe" required="true"
                                            value="#{identity.user.password}" styleClass="form-control" />
                                        <p:message for="password" display="tooltip" /> <i
                                        class="ace-icon fa fa-lock"></i>
                                </span>
                                </label>

                                <div class="space"></div>

                                <div class="clearfix">
                                    <!--  
                            <h:commandButton id="loginResetId"
                                styleClass=" width-35 pull-right btn btn-sm
                                btn-primary bigger-110"
                                value="Logout" action="#{auth.doLogOut()}">
                            </h:commandButton>
                            -->
                                    <button type="submit" jsf:action="#{identity.doLogin()}"
                                        class="width-35 pull-right btn btn-sm btn-primary">
                                        <i class="ace-icon fa fa-key"></i> <span class="bigger-110">S'identifier</span>
                                    </button>
                                    <br></br> <br></br>
                                    <h:panelGrid
                                        rendered="#{not empty authentificationBean.message}">
                                        <div class="alert alert-danger">

                                            #{authentificationBean.message} <br />
                                        </div>

                                    </h:panelGrid>
                                </div>
                            <h:outputLink id="pdfLink" value="http://localhost:18080/openCars/pdf/tableauAssurance.pdf" style="color: #000000;text-decoration: underline"><h5><b>Annexe à l'avenant</b></h5></h:outputLink>
                            <p:tooltip id="toolTipTrack" for="pdfLink" value="Télécharger l'annexe de l'avenant" trackMouse="true" />   
                                <div class="space-4"></div>
                            </fieldset>
                        </h:panelGrid>
                    </h:form>
                    <!--  
                <div class="social-or-login center">
                    <span class="bigger-110">Or Login Using</span>
                </div>

                <div class="space-6"></div>

                <div class="social-login center">
                    <a class="btn btn-primary"> <i class="ace-icon fa fa-facebook"></i>
                    </a> <a class="btn btn-info"> <i class="ace-icon fa fa-twitter"></i>
                    </a> <a class="btn btn-danger"> <i
                        class="ace-icon fa fa-google-plus"></i>
                    </a>
                </div>
                -->
                </div>
                <!-- /.widget-main -->
                <h:form id="loginNavId">
                    <div class="toolbar clearfix">
                        <div></div>


                    </div>
                </h:form>
            </div>
            <!-- /.widget-body -->
        </div>
        <!-- /.login-box -->
    </ui:define>
</ui:composition>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-06-30 20:12:19

你可以在页面中加入这段CSS,使其居中显示:

代码语言:javascript
复制
div.ui-growl {
   left: 50%;
   right: 0;
   margin-left:-150px;
}
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44844852

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档