How to center the content of a web page
Create a "wrapper" div to hold all your content and apply its width property through CSS, then give it a margin:auto attribute
<style type="text/css">
#wrapper {width: 760px;margin:auto}
#content{background-color:red}
</style>
</head>
<body>
<form id="form1" runat="server">
<div id="wrapper">
<div id="content">
content
</div>
</div>
</form>
</body>
Currently rated 3.00 by 4 people
Rate Now!
Date Posted:
05 May 2007 20:48
Last Updated:
12 July 2010 06:22
Posted by:
Mikesdotnetting
Total Views to date:
6184



Comments
12 July 2010 06:04 from Mikey
I don't know if this was intended, but in your snippet above. I think you have an extra <div id="wrapper">
12 July 2010 06:23 from Mikesdotnetting
@Mikey,
Thanks for spotting that. I have corrected it.