CSS Centering Horizontal + Vertical in Grid with scrolling support

Date: 2021-03-26
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
.parent {
display: grid;
overflow: auto;
/* optional */
position:absolute;
top:0;
left:0;
width:100%;
height: 100%;
}
.parent>.child{
justify-self: center;
align-self: center;
/* optional */
padding: 15px;
}
.parent { display: grid; overflow: auto; /* optional */ position:absolute; top:0; left:0; width:100%; height: 100%; } .parent>.child{ justify-self: center; align-self: center; /* optional */ padding: 15px; }
.parent {
    display: grid;
    overflow: auto;
    /* optional */
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height: 100%;
}

.parent>.child{
    justify-self: center;
    align-self: center;
    /* optional */
    padding: 15px;
}
47860cookie-checkCSS Centering Horizontal + Vertical in Grid with scrolling support
0 of 2000 max characters.