Skip to content
Advertisement

Bootstrap modal being rendered inside side bar

I’m losing my head over this modal which keeps showing up inside my side div area, I haven’t found anything about it on the bootstrp5 documentation nor on any online forums.

image rendering page

I just need it to render centered on the page, and the fade effect to affect all background, as per the bootstrap documentation (https://getbootstrap.com/docs/5.0/components/modal/). But I haven’t found any way to make it work…

I’m using bootstrap 5 (custom.css) with the following frontend code:

HTML:

JavaScript

Navlayout CSS:

JavaScript

JS:

JavaScript

Advertisement

Answer

You add width to the .show in @media screen and (min-width: 768px) section. And you should not do this. If you want to change the size of the modal you can set width for .modal-dialog class

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement