Sometimes, we want to change background opacity when Bootstrap modal is open with CSS.
We’ll look at how to change background opacity when Bootstrap modal is open with CSS, in this article.
How to change background opacity when bootstrap modal is open with CSS?
To change background Opacity , we set the opacity
style in the modal-backdrop
class when Bootstrap modal is open with CSS.
For instance, we can write
.modal-backdrop {
opacity: 0.5 !important;
}
to set the elements with class modal-backdrop
to have opacity 0.5.
Conclusion
To change background Opacity , we set the opacity
style in the modal-backdrop
class, when Bootstrap modal is open with CSS.