center with "flex"

้‡้ปž

/* CSS reset */
:root {
    box-sizing: border-box;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: inherit;
}

/* body */
body {

    /* flex */
    display: flex;
    justify-content: center;    /* โญ๏ธ ๆฐดๅนณ็ฝฎไธญ */
    align-items: center;        /* โญ๏ธ ๅž‚็›ด็ฝฎไธญ */
    
    min-height: 100vh;          /* โญ๏ธ ๅผท่ฟซไฝฟ็”จๅ…จ้ƒจ้ซ˜ๅบฆ */
}

ๅฏฆไพ‹

ๅƒ่€ƒ

Last updated