如何仅向按钮区域添加背景颜色?

时间:2021-05-31 19:38:59

if i add background:#e7eef9; to jQuery("#div_element").dialog, this will be appended to whole dialog. How can i append this to buttons area only?

如果我添加背景:#e7eef9;到jQuery(“#div_element”)。对话框,这将被附加到整个对话框。我怎样才能将它附加到按钮区域?

function test(buttonEl)
{
    jQuery("#div_element").dialog({
         resizable: false,
         height:200,
         modal: true,
         width: 300,
         buttons: {
            Cancel: function() {
                 jQuery( this ).dialog( "close" );
            }
         }
    });
}

1 个解决方案

#1


3  

Use the general sibling combinator ~.

使用通用兄弟组合器〜。

CSS:

CSS:

#div_element ~ .ui-dialog-buttonpane button {
    background: e7eef9;
}

#1


3  

Use the general sibling combinator ~.

使用通用兄弟组合器〜。

CSS:

CSS:

#div_element ~ .ui-dialog-buttonpane button {
    background: e7eef9;
}