Click to See Complete Forum and Search --> : "Aligning" site so when the window is maximized, it looks the same.


AlphaO
09-16-2005, 12:51 AM
I just started to make a website for fun and i was wondering how to "center" the site. Like when you maximize the window, there is a section for your site and it stays the size and how it looks, just bigger side borders. Any help would be appreciated. Thanks.

Fang
09-16-2005, 01:01 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>center contents</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<style type="text/css">
<!--
body {
text-align:center;
}
#container {
margin:0 auto;
width:600px;
text-align:left;
}
#contents {border:1px solid red;}
-->
</style>

</head>
<body>
<div id="container">
<div id="contents">
<p>centered contents</p>
</div>
</div>
</body>
</html>

AlphaO
09-16-2005, 01:18 AM
Thanks a lot Fang. It worked :). That was a fast reply too :)