3 ms·
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 t
by SahAssar 8y ago
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?
- tiglionabbit 8y agoIt even works if you just say `margin:auto` on the flex child
- SahAssar 8y agoOnly if it's a block or inline-block child though, right?
- throwaway413 8y agoNo, margin auto will center the child regardless of display property so long as the parent is a flexbox.
- ergothus 8y ago"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".