Centering page

liunx

Guest
Just curious how I would go about getting my page centered. Right now it's all the way to the left. I would also like to get a different color surrounding the entire page once it is centered. I have it all white except for the key colors (Greens, gray and red). I would like to keep the white color for the main content but maybe do a 1-2 inch border around that.
Basically is there a way of doing this without drastically changing the code?
I'm going to play with it to see how I do on my own but any help would be great.
Here is the link...Graphic Ills (<!-- m --><a class="postlink" href="http://www.graphic-ills.com">http://www.graphic-ills.com</a><!-- m -->)text-algin:center;
margin: 2em auto;Where would I place that in the code?
And would it center the entire page without throwing everything else out of whack?put a wraper around your whole layout
<div id="wrap">

blah your stuff you have rite now
</div>

#wrap{
text-algin:center;
margin: 2em auto;
}Aahh. Okay.
I'll give it a shot and see what happens. Thanks for making your text a bit bigger. It was killing my eyes trying to read your first post lol.Hmmm...well I'm trying but it doesn't seem to be doing anything. I must be placing it wrong.this is how you do it. iduno just look at my code and comapiar it to urs :D
<!-- m --><a class="postlink" href="http://doubleimage.net/faux.htmlAnyone">http://doubleimage.net/faux.htmlAnyone</a><!-- m --> else have any suggestions? I use div tags throughout my page and I need a method of centering that uses div tags as well. I want the entire content to center no matter what web browser is being used and maybe even a thin border around it. Maybe it's just too late at night for me to get what you were trying to tell me Jupac. Too many damn nights of working long ass hours.
Anyway I appreciate the help given so far.well you could look at my code, it has divs in divs and is centered, due to the settings of the horizon div

<!-- m --><a class="postlink" href="http://hive-dev.net/chris/">http://hive-dev.net/chris/</a><!-- m -->

just look at the code thereJust give #container your required width.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>center page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
html, body {margin:0;background:#fcc;}
#centered {text-align:center;}
#container {margin:0 auto; width:80%; text-align:left;}
#contents {background:#fff;border:1px solid red;}
-->
</style>
</head>
<body>
<div id="centered"><div id="container">
<div id="contents">
<p>contents</p>
</div>
</div></div>
</body>
</html>
 
Back
Top