使用CSS样式修复jQuery对话框中的空白
我试图使用CSS样式显示jQuery对话框,但对话框中有一小块空白 jQuery代码:使用CSS样式修复jQuery对话框中的空白,jquery,html,css,Jquery,Html,Css,我试图使用CSS样式显示jQuery对话框,但对话框中有一小块空白 jQuery代码: $('#success').dialog({ //autoOpen: true, height: 180, width: 350, modal: true, resizable: false, dialogClass: 'no-close', buttons: [ { text: "Add",
$('#success').dialog({
//autoOpen: true,
height: 180,
width: 350,
modal: true,
resizable: false,
dialogClass: 'no-close',
buttons: [
{
text: "Add",
click: function() {
// Cancel code here
}
}
]
//closeOnEscape: false,
//open: function(event, ui) { $(".ui-dialog-titlebar-close", ui).hide(); }
//closeOnEscape: false,
//beforeclose: function (event, ui) { return false; },
});
<div id="popup-msg">
<div id="loading">
<h2>Loading...</h2>
<h3>Please wait a few seconds.</h3>
</div>
<div id="success" title="Add To List" style="border: 1px solid black">
<p style="padding:0;">User table is updated.</p>
</div>
</div>
HTML代码:
$('#success').dialog({
//autoOpen: true,
height: 180,
width: 350,
modal: true,
resizable: false,
dialogClass: 'no-close',
buttons: [
{
text: "Add",
click: function() {
// Cancel code here
}
}
]
//closeOnEscape: false,
//open: function(event, ui) { $(".ui-dialog-titlebar-close", ui).hide(); }
//closeOnEscape: false,
//beforeclose: function (event, ui) { return false; },
});
<div id="popup-msg">
<div id="loading">
<h2>Loading...</h2>
<h3>Please wait a few seconds.</h3>
</div>
<div id="success" title="Add To List" style="border: 1px solid black">
<p style="padding:0;">User table is updated.</p>
</div>
</div>
加载。。。
请稍等几秒钟。
更新用户表
您对解决此问题有什么建议吗?您可以添加此CSS:
.ui-dialog .ui-dialog-buttonpane {
margin: 0;
border: 0;
}
您可以添加以下CSS:
.ui-dialog .ui-dialog-buttonpane {
margin: 0;
border: 0;
}
在CSS中添加以下行:
.ui-dialog .ui-dialog-buttonpane
{
margin-top: 0px;
}
在CSS中添加以下行:
.ui-dialog .ui-dialog-buttonpane
{
margin-top: 0px;
}
这是插件的默认行为。您需要覆盖插件类
.ui-dialog .ui-dialog-buttonpane
{
margin:0px;
}
我将整个边距设置为零,而不是将顶部边距设置为零,因为左、右、底部已为零这是插件的默认行为。您需要覆盖插件类
.ui-dialog .ui-dialog-buttonpane
{
margin:0px;
}
我给了整个边距为零,而不是顶部边距,因为左、右、底部已经为零