Slip Slip - 1 year ago 114
HTML Question

Centering div in modal window

I'm using flexbox in my modal window. But it doesn't vertically center.

.menu-wrapper {
display: flex;
align-items: center;
justify-content: center;
align-content: center;
.menu-window {
display: flex;
margin: auto;


Answer Source

When you open modal the display propiety changes to block. Set the display to flex:

function topMenuShow() { = ( === "flex") ? "none" : "flex";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download