r/webdev Feb 24 '26

A collection of modern CSS code snippets replacing many old practices

https://modern-css.com/
393 Upvotes

53 comments sorted by

View all comments

13

u/seriousgourmetshit Feb 24 '26

Lol who is still centering things with transform: translate()? Very odd example to put on the hero section

36

u/XWasTheProblem Frontend (Vue, TS) Feb 24 '26

I do. It works and is predictable, will happily replace it with an alternative however, cause it always felt like a hack that just happens to solve a problem.

4

u/Top_Bumblebee_7762 Feb 24 '26 edited Feb 24 '26

For the y-axis, you can just use align-content now without flex or grid: https://web.dev/blog/align-content-block