2
Contributors
1
Reply
3
Views
9 Years
Discussion Span
Last Post by katarey
0

This Code Will Help You,

In this page middle_Div will always center aligned (vertical and horizontal)
even web browser resized, there may many more ways to do this,
but this is first which I have got in my mind after seen you post, and its easiest
way (I hope) ;)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css" >
<!--
html{
height:100%;
}
body {
	background:#99ccff url(bg_gradient.jpg) top repeat-x; 
	/**** 
	make bady background color same as you have in bottom in the gradient
	this will help you when your page height more then the image
	****/
	margin:0px;
	padding:0px;
	height:100%;
}
#middle_Div{
width:450px;
height:450px;
margin-right:auto;
margin-left:auto;
background:#fff;
}
table{
height:100%;
}
/*************************/
/****Rahul Dev Katarey*****/
/****www.katarey.com******/
/************************/
-->
</style>
</head>
<body>
<!--Table Will Take Care of Vertical align for div in middle of page -->
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><div id="middle_Div">Content for  id "middle_Div" Goes Here</div></td>
  </tr>
</table>
</body>
</html>

Regards,
Rahul Dev Katarey

Attachments
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.