标题引导箱问题

Issue with title bootbox

谁能告诉我怎么解决?我在警告框中有相同的标题问题。

bootbox.confirm({
    title: "Confirmation",
    message: "Are you sure you want to delete the selected items?",
    buttons: {
        confirm: {
             label: 'Yes',
             className: 'btn-success',
        },
        cancel: {
            label: 'No',
            className: 'btn-danger'
        }
    },
    callback: function (result) {
                    if (result == true) {
                        $("#delete").submit();
                    } 
                }
    });

你好像搞砸了一些 CSS。

也许您正在使用另一个覆盖引导框样式的库。

您可以尝试以下方法来解决该特定问题:

.bootbox .modal-header h4 {
  float: none;
}

.bootbox .modal-header .close {
  position: absolute;
  right: 15px;
}

是版本问题。 如果你使用的是 boot-box v4.x 那么你需要 Bootstrap v5.x

所以检查版本。

如果您无法使版本兼容,请按照以下代码:

closeButton = $('.bootbox').find('.bootbox-close-button');
$('.bootbox').find('.modal-header').append(closeButton);

它正确地重新排列了关闭按钮。