9238 shaares
221 private links
221 private links
More techniques than Resource: The Complete Guide to Centering in CSS | Modern CSS Solutions.
It covers a lot of cases:
- when the element size is known or unknown
- depending of the layout algorithm currently used
As I write this in early 2024, browser vendors are in the process of implementing align-content in Flow layout, so that it controls the “block” direction alignment of content.
🤯 so we will be able to stick to the default layout.
So, for many years, I treated CSS like a collection of patterns. I had a bunch of memorized snippets that would paste from my brain, to solve whatever problem I was currently facing.