I can horizontally align a div and all the content looks nice. Looking to vertical align a div that does not contain any tables. I tried setting margin positions to some negative values inside of the #container but that sort of worked. I know CSS isn't supporting this yet?
Here is my markup:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>
</title>
</head>
<style type="text/css">
body
{
background: #000000 url(body_bg.gif) repeat-x;
text-align: center;
}
#container
{
margin:0 auto;
width:968px;
text-align: left;
}
#toptab
{
background: url(panel_top.png);
height: 14px;
width: 968px;
}
#middletab
{
background: url(panel_bg.png);
width: 968px;
}
#data
{
width:948px; /* 948 for the box plus we need 20 more px to handle the padding */
padding-left:10px;
padding-right:10px;
}
#bottomtab
{
background: url(panel_bottom.png);
height: 14px;
width: 968px;
}
</style>
<body>
<div id="container">
<div id="toptab"></div>
<div id="middletab">
<div id="data">
The quick brown fox jumped over the big red bear. The quick brown fox jumped over the big red
bear. The quick brown fox jumped over the big red bear. The quick brown fox jumped over the big
red bear. The quick brown fox jumped over the big red bear. The quick brown fox
jumped over the big red bear. The quick brown fox jumped over the
big red bear. The quick brown fox jumped over the big red bear. The quick brown fox jumped over the
big red bear. The quick brown fox jumped over the big red bear. The quick brown fox jumped over the
big red bear. The quick brown fox jumped over the big red bear. The quick brown fox jumped over the big
red bear.
</div>
</div>
<div id="bottomtab"></div>
</div>
</body>
</html>
Take a close look at the #container, this is the container I want to align vertically. The effect would force the entire div and all sub divs to not only be horizontally aligned but also vertically. I know this is possible and I know andy budd posted such a solution but it doesn't seem to work for me!
Here is what the page currently looks like:
So it looks great horizontally but now I need it to center vertically in the page.