I think this will help you with your problem ^____^
HTML Code:
<html>
<head>
<title>ABSOLUTE CENTER CONTENT</title>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
body {
background-color: #666666;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td width="600" height="400" align="center" valign="middle" bgcolor="#000000"><span class="style1"><strong>ABSOLUTE CENTER CONTENT</strong><br>
<small>(600x400 px)</small></span></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
View sample
although it's a table based layout... you can do this on css as well.
HTML Code:
<html>
<head>
<title>ABSOLUTE CENTER CONTENT (CSS version)</title>
<style>
body {
padding: 0px;
margin: 0px;
height: 100%;
width: 100%;
background-color: #666666;
}
#container {
height: 100%;
width: 100%;
display: table;
}
#container #mainContent {
width: 600px;
height: 400px;
position: absolute;
display: table-cell;
top: 50%;
left: -300px;
margin-top: -200px;
margin-left: 50%;
background-color: #000000;
}
#container #mainContent #textCenter {
width: 600px;
height: 400px;
color: #ffffff;
display: table-cell;
vertical-align: middle;
text-align: center;
}
</style>
</head>
<body>
<div id="container">
<div id="mainContent">
<div id="textCenter">
<strong>ABSOLUTE CENTER CONTENT (CSS version)</strong><br /><small>(600x400 px)</small></p>
</div>
</div>
</body>
</html>
View sample
if you notice, on IE browsers, the text on the css version is not centered horizontally. you may need to insert some javascript in order to fix that issue.
^______^