html - Flexbox: center horizontally and vertically - Stack Overflow

PHOTO EMBED

Tue Aug 02 2022 13:27:40 GMT+0000 (UTC)

Saved by @RitvikBuxi321 #css

#container {
    display: flex;           /* establish flex container */
    flex-direction: column;  /* make main axis vertical */
    justify-content: center; /* center items vertically, in this case */
    align-items: center;     /* center items horizontally, in this case */
    height: 300px;
}

.box {
    width: 300px;
    margin: 5px;
    text-align: center;     /* will center text in <p>, which is not a flex item */
}
content_copyCOPY

css of title

https://stackoverflow.com/questions/19026884/flexbox-center-horizontally-and-vertically