Click to See Complete Forum and Search --> : center page


sandro27
06-28-2005, 09:50 AM
Hi,

I am having problems to center the <body> content in the middle when the screen size is larger than 600 X 800. In this case ( larger screens) the tables and cells occupy diferent parts of the screen messing up the general outlook.

The solution I tought would be to use a <div center> just before the <body> tag and at the end of it but there might be more effective solutions for this problem using external CSS sheets.

The page I am talking about is at Floripa (http://www.floripaimages.com)

Appreciate any help.

Cheers

ffurnai
06-28-2005, 10:52 AM
a <div> before the <body> tag = invalid code.

to center everything within the <body> add this to the style
<head>
<style type="text/css">
body {
text-align: center;
}
</style>
</head>

but, this centers everything.

Another way would be to have a central "wrapper" div
<head>
<style type="text/css">
#wrapper {
width: 500px;
border: 1px solid #ccc;
margin: 0 auto;
}
</style>
</head>
<body>
<div id="wrapper">Stuff</div>
</body>

sandro27
06-28-2005, 11:15 AM
Hi,

thanks for your reply.unfortunately the wrap solution didnīt work well cuz I am using Css to align other objects, so what happens is "wrap" centers only the middle collumn. I need all the elements to be centered in a large screen to viewed like in a 600X 800 but of course with the spaces on the right and left sides.

ffurnai
06-28-2005, 12:16 PM
Hmmmm, I guess I don't really understand what you're trying to achieve. You can put all your columns within the #wrapper div but change the width to be 800px.