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

The height of the outer element is determined by the height of the children, plus padding. Since you have only one child, then the outer element is as tall as that one child, plus padding. Ergo, assuming symmetrical vertical padding, the inner element will by definition be centered.

It would be as if I wrote a tutorial on how to make one element fill the entire viewport, and one of my methods was "put all your content in the <body> tag" and I said that was a way to fill the viewport. That is the trivial case, it's a degenerate solution!



> it's a degenerate solution!

Well, there you go. :-)




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

Search: