My application features many modals, all with different widths. I understand you can set the width of a modal inline by doing something like:width: 400px margin-left: -200px;This works when the window is at 100%, but if you resize the window and it gets down to a small enough width the window is now -200px off of the screen. If I don't use margin-left: -200px then the window is not centered on the page at all.
In summary, I want to be able to set different widths to my modal windows, have them center on the screen when opened, and if the screen is resized the modal window needs to slide and stay in the center of the screen.
There has to be a more effieicent way to center these modal windows...
Any help is greatly appreciated.
In summary, I want to be able to set different widths to my modal windows, have them center on the screen when opened, and if the screen is resized the modal window needs to slide and stay in the center of the screen.
There has to be a more effieicent way to center these modal windows...
Any help is greatly appreciated.