Gunnar Bittersmann: Ausrichtung mit flex

Beitrag lesen

@@Rolf B

body {
   margin: 5px auto;
   height: calc(100vh - 10px);
}

Ugh, kein single point of truth.

Das sollte eher so gemacht werden:

body {
  --body-margin-block: 5px;
  margin: var(--body-margin-block) auto;
  height: calc(100vh - 2 * var(--body-margin-block));
}

Noch eher in em o.ä. statt px.

Und noch eher dvh statt vh.

Aber noch eher würde ich den Abstand nullen und den Gridzellen padding verpassen.

🖖 Live long and prosper

--
“In my home, the America I love, the America I've written about, that has been a beacon of hope and liberty for 250 years, is currently in the hands of a corrupt, incompetent and treasonous administration. Tonight, we ask all who believe in democracy and the best of our American spirit, to rise with us, raise your voices against authoritarianism, and let freedom reign.”
— Bruce Springsteen, Manchester 2025-05-14