7

我想更改 JQueryUI 对话框的背景颜色。我使用以下样式对其进行了更改,并且可以正常工作。但问题是它也有效果,DatePicker Dialog Title。我只想更改对话框标题而不是 DatePicker 标题。你能告诉我如何只改变对话框瓷砖的颜色吗?谢谢。

.ui-widget-header
{
    background-color: #F9A7AE;
    background-image: none;
    color: Black;
}
4

1 回答 1

15

You can target the titlebar directly, the dialog plugin will output HTML similar to the following for the dialog title:

<div class="ui-dialog-titlebar ui-widget-header">
  <span id="ui-id-1" class="ui-dialog-title">Basic dialog</span>
</div>

(Taken from the Dialog page, here)

.ui-dialog-titlebar {
  background-color: #F9A7AE;
  background-image: none;
  color: #000;
}

Alternatively, you can pass a class to the dialog:

$('#foo').dialog({dialogClass: 'myClass'});

See here

于 2012-10-15T10:47:16.453 回答