首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何覆盖对话框窗口primefaces中主题并设置用户定义的CSS

如何覆盖对话框窗口primefaces中主题并设置用户定义的CSS
EN

Stack Overflow用户
提问于 2014-02-26 14:41:16
回答 1查看 16.1K关注 0票数 2

我正在使用primefaces 3.5,我想在完成任何操作后显示对话框窗口。对话框应如下所示

但我不知道为什么我的被覆盖的主题不起作用,我尝试了很多次,我有这样的输出

我覆盖的css是这样的

代码语言:javascript
复制
.ui-widget-content{
    background-color:white;

}
.ui-helper-clearfix:after{
    background-color:green!important;

}
.ui-widget-header{
    background:green!important;

}
.ui-shadow{

    box-shadow:none;
}
.ui-dialog-content{
    background:white!important;

    padding: 0,0,0,0!important;
}

我的xhtml文件代码是这样的:

代码语言:javascript
复制
<h:form id="form6"> 
                            <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true"  /> 


        <h:button id="button1" onclick="ex.show();return false;" value="Ex alternis sermonibus" actionListener="#{indexBean.addInfo}"/>


        <h:button id="button2"  onclick="radicalis.show();return false;" value="Radicalis alternis sermonibus"/>

    <p:commandButton id="infoButton" value="Info" actionListener="#{indexBean.addInfo}"/>         

</h:form> 
        <h:form id="form1">
            <h:outputText id="hail"/>
        </h:form>

        <h:outputText id="hail-outside" />

        <p:dialog id="dialog1" header="Success" modal="true" resizable="false" style="height: 121px!important;left: 18px!important;width: 295px!important;"   appendToBody="true"  widgetVar="ex"
         styleClass="ui-widget-content ui-helper-clearfix:after ui-widget-header ui-shadow .ui-dialog .ui-dialog-content">
            <h:form id="form2">
                <h:outputText value="You have successfully complete the action" ></h:outputText>
                <p:commandButton value="ok" >

                </p:commandButton>
            </h:form>
        </p:dialog>

        <p:dialog id="dialog2"  appendToBody="true" modal="true" widgetVar="radicalis">
            <h:form id="form3">
              <h:outputText value="Welcome here every one"></h:outputText>
            </h:form>
        </p:dialog>

请告诉我我的css出了什么问题

EN

回答 1

Stack Overflow用户

发布于 2018-07-12 04:26:55

在我的例子中,css是不同的,因为我想改变边框的颜色

代码语言:javascript
复制
<p:dialog id="dialog1" header="Success" modal="true" resizable="false" appendToBody="true"  widgetVar="ex" width="295" height="181"
 styleClass="customDialog">

CSS

代码语言:javascript
复制
.customDialog {
    color : white;
}

.customDialog .ui-dialog-titlebar.ui-widget-header {
    background: green !important;
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22033722

复制
相关文章

相似问题

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