更改 twitter bootstrap 模式中的背景颜色? [英] Change the background color in a twitter bootstrap modal?

查看:40
本文介绍了更改 twitter bootstrap 模式中的背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 twitter bootstrap 中创建模态时,有没有办法改变背景颜色?完全去除阴影?

When creating a modal in twitter bootstrap, is there any way to change the background color? Remove the shading entirely?

注意:对于去除阴影,这不起作用,因为它也会改变点击行为.(我仍然希望能够在模态之外单击以将其关闭.)

NB: For removing shading, this doesn't work, because it also changes the click behavior. (I still want to be able to click outside the modal to close it.)

$("#myModal").modal({
  backdrop: false
});

推荐答案

通过以下方式改变颜色:

To change the color via:

将这些样式放在样式表中引导样式之后:

Put these styles in your stylesheet after the bootstrap styles:

.modal-backdrop {
   background-color: red;
}

将引导变量更改为:

Less

Changes the bootstrap-variables to:

@modal-backdrop-bg:           red;

来源

将引导变量更改为:

$modal-backdrop-bg:           red;

来源

@modal-backdrop-bg 更改为您想要的颜色:

Change @modal-backdrop-bg to your desired color:

getbootstrap.com/customize/

您也可以通过 Javascript 或将颜色设置为 transparent 来移除背景.

You can also remove the backdrop via Javascript or by setting the color to transparent.

这篇关于更改 twitter bootstrap 模式中的背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆