The state of CSS centering in 2026

“The State of CSS Centering in 2026” title in white on dark, an orange square next to the word “CENTER” in serif, framed by orange dashed baseline guides, CSS-Tricks logo below.

Temani Afif breaks down the many valid ways to center in CSS and shows how to pick the right one. He covers alignment theory with two levels and two axes, compares flexbox, grid, position: absolute, and text-align, explains the text-box property for trimming whitespace around glyphs, anchor-center in anchor positioning, and the difference between safe and unsafe centering.

css-tricks.com/the-state-of-css-centering-in-2026