Bootstrap 3 modal overlay background color and animation

旧巷老猫 提交于 2019-12-06 01:25:01

问题


I'm having some issues changing the background color when the Modal Window is displayed using Bootstrap 3.

Ideally I want it to be more of a black and tone down the opacity a bit, but when you click on the boxes located here;

http://roblb.devour.org/march2014/index%20copy.html

Also - how do I stop the Modal sliding down? I just want it to fade in? I've seen a few items on here, but none of them actually answer this...

Thanks

Rob


回答1:


To change the backdrop color you can use this:

.modal-backdrop {
  background-color: #0000ff;
}

or separate into clases:

.modal-blue .modal-backdrop {
  background-color: #0000ff;
}

.modal-white .modal-backdrop {
  background-color: #ffffff;
}

and then add the class to your div:

<div class="modal fade modal-white" ... >
  <div class="modal-dialog">
      ...
  </div>
</div>

to stop sliding down remove the "fade" class.

Hope this help,

regards.




回答2:


Easy remedy is to override the default. Just use:

.fade.in {
   background: #000; // or whatever you like
}



回答3:


I used :

.modal {
  background-color:black;
}

And it worked.



来源:https://stackoverflow.com/questions/23213344/bootstrap-3-modal-overlay-background-color-and-animation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!