css - p :confirmDialog how to change the image and text color

标签 css image primefaces modal-dialog graphic

我需要使用素面显示确认对话框。但我需要有一个自定义图标(黄色三 Angular 形)和红色文本。通过使用以下内容,我得到了一个带有黑色文本的蓝色三 Angular 形,我不确定如何使用我的图标以及设置对话框文本的样式。

    <p:column id="billing_address_unassign"
    headerText="#{billingAccount_msgs['addresses.table.column.unassign']}"
    styleClass="col10">
    <p:commandButton immediate="true" id="address_unassign"
        styleClass="cart-button-class" icon="delete"
        title="#{billingAccount_msgs['unassign.address.tooltip.text']}"
        oncomplete="unassignBillingAddressConfirmationDialog.show()">
        <f:setPropertyActionListener value="#{billingAddress}"
            target="#{billingAddressBean.selectedBillingAddress}" />
    </p:commandButton>
</p:column>
  </p:dataTable>

  <p:confirmDialog appendToBody="true"
id="unassignBillingAddressConfirmationDialog"
styleClass="confirm-dialog"
message="#{billingAccount_msgs['unassignBillingAddress.confirmation']}"
header="#   
    {billingAccount_msgs['unassignBillingAddress.confirmation.dialog.header']}"
   severity="alert" widgetVar="unassignBillingAddressConfirmationDialog">

最佳答案

您必须创建自己的黄色图标,然后在确认对话框中放置您的图标而不是默认图标。只需使用 css 即可将文本更改为红色。

将以下内容添加到您的 CSS 文件中:

/*Red text in confirm dialog*/
.ui-confirm-dialog .ui-dialog-content p { color: red; }

/*Yellow triangle in confirm dialog */
.ui-confirm-dialog .ui-dialog-content p span { background-image: url("#resource['images:yellow-triangle.png']}") no-repeat}

关于css - p :confirmDialog how to change the image and text color,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12823827/

相关文章:

html - 如何以相同的间距内联定位div

html - 如何让进度条从右向左过渡,而不是从左向右过渡?

css - 在 CSS 中动态赋值

javascript - p :calendar for only month and year

c# - 如何在一张图片中找到另一张图片?

jsf-2 - PF筛选包含日期的数据表列

css - 如何在 webkit、opera 浏览器的 f/ckeditor 中禁用所选图像的蒙版?

css - 如何在动画期间修复按钮的堆叠/z-index?

android - Retrofit2 将图像发布为 base64

css - 我的网站在 safari 浏览器中的图像拉伸(stretch)