Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 4 Modal Opacity

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?

like image 600
Koder Avatar asked Sep 29 '17 09:09

Koder


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.

like image 179
roberrrt-s Avatar answered Oct 05 '22 23:10

roberrrt-s