Jason Knight
Dec 1, 2021

--

Little tip -- if your content ends up taller than the browser window and you use flex or grid, the top will get chopped off if you don't set an auto-margin top and bottom.

Yes, the value that used to be ignored / do nothing, now serves a purpose.

The nice part of that is that unlike the absolute positioning approach, you can have it not chop it off or have to play with overflow... and you can implement it in ways that don't need you to declare sizes on everything... since fixed layouts are inherently trash.

Also px? Naughty naughty!

-- edit -- oh, and you're not technically centering with tables there. You're using tables BEHAVIOR, not actual tables. It's a minor distinction, but an important one to make since you risk some nose-breather screaming "tables for layout evil" when you in fact have nothing of the sort.

--

--

Jason Knight
Jason Knight

Written by Jason Knight

Accessibility and Efficiency Consultant, Web Developer, Musician, and just general pain in the arse

No responses yet