Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> corresponding to the `vertical-align` CSS property on an `inline`, `inline-block` or `table-cell` box.

I can't believe I didn't know about this until now.

Before flexbox and grid, I don't know how many times have I written `position: relative;` on parent, and `position: absolute; top: 50%; left: 50%; transform: translateX(-50%) translateY(-50%);` on the thing I wanted to put in the middle (vertically and horizontally).



Ya, I remember reading tutorials that suggested this. It was a very confusing time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: