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

Centering is just `display:flex;align-items:center;justify-content:center;` on the parent. Equal height columns is just `display:flex;` on the parent. How is that not simple?


"Here's the 'display' property. It controls how the element is treated for flow. Or it decides how to change how the children are centered, when it's 'flex'. BTW, display:flex is totally unrelated to all other forms of flow control. We have multiple ways to center content, and vertical centering vs horizontal centering are not the same."

It's not impossibly complex, or even highly complex, but compared to any non-CSS layout, it's not simple. Only if you compare it to previous CSS layouts is it "simple".


It even works if you just say `margin:auto` on the flex child


Only if it's a block or inline-block child though, right?


No, margin auto will center the child regardless of display property so long as the parent is a flexbox.




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

Search: