So i'm using Bootstrap 4 Beta and want to darken the Background when a Modal is shown. I saw a post where i just had to add the css class
.modal-backdrop.in {
opacity: 0.5 !important;
position: fixed;
}
to my CSS file. They wrote i don't need to add the class to the div, just add it inside the CSS file. So if i just add it, it happens nothing. If i then add the class also to my modal div everything will get the opacity, even the modal itself. Does somebody know how to fix that?
Just update the current CSS class for the modal by overwriting it.
.modal-backdrop.show {
opacity: 0.8;
}
Where .show
is the class containing the opacity for your background.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With