Click to See Complete Forum and Search --> : Centering page
Vanda
02-10-2005, 10:59 PM
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 (http://www.graphic-ills.com)
Jupac
02-10-2005, 11:05 PM
text-algin:center;
margin: 2em auto;
Vanda
02-10-2005, 11:06 PM
Where would I place that in the code?
And would it center the entire page without throwing everything else out of whack?
Jupac
02-10-2005, 11:42 PM
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;
}
Vanda
02-10-2005, 11:54 PM
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.
Vanda
02-11-2005, 12:04 AM
Hmmm...well I'm trying but it doesn't seem to be doing anything. I must be placing it wrong.
Jupac
02-11-2005, 12:14 AM
this is how you do it. iduno just look at my code and comapiar it to urs :D
http://doubleimage.net/faux.html
Vanda
02-11-2005, 03:09 AM
Anyone 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.
Fantatier
02-11-2005, 05:40 AM
well you could look at my code, it has divs in divs and is centered, due to the settings of the horizon div
http://hive-dev.net/chris/
just look at the code there
Just 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>