- Using the Grid
.CenterDiv {
display: grid;
place-items: center;
}
- Using flex
.CenterDiv {
display: flex;
justify-content:center;
align-items: center;
}
- place content
.CenterDiv {
display: grid;
height: 100vh;
place-content: center;
}