Vertically Align Div in Center of page

Hi,

I have created a holding page for a website which consists of a 900x550px div positioned on a black body background. I have managed to achieve horizontal centralising by specifying the width in the CSS and then applying automatic margins, but I also wish to align the div centrally vertically as well.

This is my current HTML structure:

<html>
<body>
<div id="container"></div>
</body>
</html>

The 'container' div is what i want aligning centrally vertically. Does anybody know of a CSS method that will achieve this?

LVL 1
rob22888Asked:
Who is Participating?
 
David S.Connect With a Mentor Commented:
Since you're using a fixed height, you could also use this technique: http://www.search-this.com/2008/05/15/easy-vertical-centering-with-css/
0
 
AtanAsfalothCommented:
Hello,

For information on vertical aligning, look at the following site.
http://phrogz.net/CSS/vertical-align/index.html
Method 1 seems to apply here.

Atan
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.