On Oct 3, 2008, at 8:43 AM, tedd wrote:
> Did someone say simple? That's me. :-)
>
> http://webbytedd.com/b2/vertical-center-tedd/
>
> And no JS needed.
Sweet, but you may want to offer some additional explanation for
those interested.
Correct me if I'm wrong, but this technique requires a fixed-height
container to center it vertically. So it would work for alerts,
logins, and other static areas, but not variable content (scrollable
divs aside).
Also, in your CSS comments it might help the original poster (and
others interested in why it works) if you added some comments about
why you are using both body {text-align:center;} AND #horizontal
{margin-left: auto;margin-right:auto;}. I only say this because the
purpose of the example seems to be to illustrate.
It's probably also worth explaining why the box is not actually
centered vertically on the page.
Great work,
Brad =)
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/