Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 3 .应用新背景时,模式标题将丢失左上角和右上角半径_Twitter Bootstrap 3_Bootbox - Fatal编程技术网

Twitter bootstrap 3 .应用新背景时,模式标题将丢失左上角和右上角半径

Twitter bootstrap 3 .应用新背景时,模式标题将丢失左上角和右上角半径,twitter-bootstrap-3,bootbox,Twitter Bootstrap 3,Bootbox,我正在使用bootbox.js向我的用户显示一些确认和错误消息。为此,我向bootbox提供了className属性,但是我注意到当我应用一个更改其背景的类时,.modal header的左上和右上半径会消失。下面是一个示例 我知道我可以通过将边界半径:5px 5px 0px 0px添加到.errorAlert.modal标头来解决这个问题,但我想首先了解为什么会发生这种情况 如果您的链接有问题,这里是重现问题的最低代码: HTML JavaScript: $(function(){ $("

我正在使用
bootbox.js
向我的用户显示一些确认和错误消息。为此,我向bootbox提供了
className
属性,但是我注意到当我应用一个更改其背景的类时,
.modal header
的左上和右上半径会消失。下面是一个示例

我知道我可以通过将
边界半径:5px 5px 0px 0px
添加到
.errorAlert.modal标头
来解决这个问题,但我想首先了解为什么会发生这种情况

如果您的链接有问题,这里是重现问题的最低代码:

HTML

JavaScript:

$(function(){
  $("#simpleModal").on("click",function(){

    bootbox.alert({title:"Just a modal",message:"With no custom class"})
  })
  $("#customClass").on("click",function(){
    bootbox.alert({title:"Just a modal",message:"With .errorAlert class applied",className:"errorAlert"})
  })
})

这是因为引导中的边界半径应用于
.modal content
并且默认情况下
.modal头
没有背景。当你将背景应用到模式标题时,边界半径消失,因为你用没有边界半径的模式标题的红色背景覆盖它们。

谢谢。我只想设置
。模式标题
这就是为什么我没有使用
。模式内容
是的,我知道,所以你必须对其应用边界半径,没有其他方法。实际上有,您可以添加
overflow:hidden
。模式内容
.errorAlert .modal-header{
  background:red;
}
$(function(){
  $("#simpleModal").on("click",function(){

    bootbox.alert({title:"Just a modal",message:"With no custom class"})
  })
  $("#customClass").on("click",function(){
    bootbox.alert({title:"Just a modal",message:"With .errorAlert class applied",className:"errorAlert"})
  })
})