I am opening a modal but when I do this the page behind the modal goes very dark. Can someone explain how I can change this. For example how could I make it so there's just a very light shading on the background.
I also notice that when I click the background then my modal disappears. Is there a way I can remove this functionality. I would like my modal to only go away when the user clicks submit or close on the modal itself.
I am opening a modal but when I do this the page behind the modal goes very dark. Can someone explain how I can change this. For example how could I make it so there's just a very light shading on the background.
I also notice that when I click the background then my modal disappears. Is there a way I can remove this functionality. I would like my modal to only go away when the user clicks submit or close on the modal itself.
Share Improve this question asked Apr 16, 2012 at 10:52 user1321237user13212373 Answers
Reset to default 8If you're looking to keep the backdrop behind the modal but make the backdrop pletely transparent, set a transparent background-color instead of changing the opacity:
.modal-backdrop, .modal-backdrop.fade.in { background-color: rgba(0,0,0,0); }
This allows you to be able to click off of your modal and have your modal close while not actually seeing the backdrop.
What your looking for is http://twitter.github./bootstrap/javascript.html#modals modal backdrop static to disable closing on background click.
Also for the backdrop darkness adjust the
.modal-backdrop, .modal-backdrop.fade.in {
opacity: 0;
}
If you are using bs 3, you can use data-backdrop="false" attribute in your link so you dont have to modify your base bootstrap files.
It's in the documentation