Y
Hacker News
new
|
ask
|
show
|
jobs
by
bonn1
4125 days ago
> Vertical centering has been relatively easy since CSS 2.1 (Table model)
But not with divs which are more common
2 comments
pcwalton
4125 days ago
It's not hard, really: just use absolute centering [1]. That's actually what "margin: auto" is there for in CSS 2.1; it's a shame they were bad at evangelizing it.
[1]:
http://codepen.io/shshaw/full/gEiDt
link
etchalon
4125 days ago
…so you use table display rules on the divs?
link
[1]: http://codepen.io/shshaw/full/gEiDt