Bootstrap 4 Modal Opacity

Viewed 8730

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?

1 Answers

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.

Related