This project is here in case you do not want to use css grid in every single project.
Vertically align items center with confidence!
see it live here: michaeldimmitt.github.io/css-center-without-grid
absolute positioning is used in this project to ensure the spans do not fight with each other.
use position relative if you want child elements to behave like normal.
see it live here: michaeldimmitt.github.io/css-center-without-grid
css center without grid:
— MichaelDimmitt (@m_dimmitt) September 7, 2019
<div style="
height:100vh;
">
<span style="
height: 10vh; width: 10vw;
background-color: aqua;
display: block;
position: relative;
top: 50%; left: 50%;
transform: translate(-50%,-50%);
">
</span>
</div>
My favorite way to organize a page vertically @letslunchpool.
— MichaelDimmitt (@m_dimmitt) May 15, 2019
display: grid;
grid-template-rows: auto auto 1fr auto;
max-height: 100vh;
As a hotsauce commercial mentions:
I put that sh*t on everything#css #grid#flexbox everything else.
Whats your whitespace strategy?