Salutations. Je présente à votre attention la traduction de l'article «Keep the Footer at the Bottom: Flexbox vs. Grid » , publié le 8 avril 2020 par Stephanie Eckles

Ceci est le premier article d'une série qui présente des moyens modernes de résoudre les problèmes CSS auxquels je suis confronté depuis plus de 13 ans en tant que développeur front-end.
Matthew James Taylor , . , , ( Flexbox).
SPA, , , , , , :
CSS: Flexbox Grid.
Flexbox. Codepen, $method grid, .
.
Flexbox
:
body {
min-height: 100vh;
display: flex;
flex-direction: column;
}
footer {
margin-top: auto;
}
/* */
main {
margin: 0 auto;
/* : align-self: center */
max-width: 80ch;
}
-, , min-height: 100vh, body , . , ( – ), , body .
flex-direction: column , .
Flexbox margin: auto. , , , ( ). , margin-top: auto .
Codepen main outline, , Flexbox, main . margin-top: auto.
, , Grid, main, .
Grid
:
body {
min-height: 100vh;
display: grid;
grid-template-rows: auto 1fr auto;
}
/**/
main {
margin: 0 auto;
max-width: 80ch;
}
min-height: 100vh, grid-template-rows .
Grid fr. fr " / " "" , . , "" Flexbox.
?
, Grid, , . , , . , , .
, Flexbox – , <article> <main>.
, , . , , – .