centre body

  • Thread starter Thread starter flamtech
  • Start date Start date
F

flamtech

Hi
I want my website to have a white body that is 800 pixels wide where I
can enter my data, and then around the body I want a border that fills
the rest of the space. So it doesnt matter what the resolution of the
visitor screen is, the body will always be in the middle.

A long time ago I did came across a website explaining how to do it,
but now I cant find it.

I tried to use tables, but that doesnt work.

The website is gratisfax.co.za

Thanks

Reynier
 
Tables don't work?
Create a table 760px wide and center it on the page



--
~~~~~~~~~~~~~~~~~~
Rob Giordano
Microsoft MVP Expression





| Hi
| I want my website to have a white body that is 800 pixels wide where I
| can enter my data, and then around the body I want a border that fills
| the rest of the space. So it doesnt matter what the resolution of the
| visitor screen is, the body will always be in the middle.
|
| A long time ago I did came across a website explaining how to do it,
| but now I cant find it.
|
| I tried to use tables, but that doesnt work.
|
| The website is gratisfax.co.za
|
| Thanks
|
| Reynier
|
 
So it doesnt matter what the resolution of the visitor screen is

Resolution is not the important variable - it's browser viewport width. You
can set MANY different viewport widths on a given resolution/size screen.
One, or more, of those widths may cause you problems.
I tried to use tables, but that doesnt work.

It will if you use a single outer table with a fixed width, and set to
center align.
 
Resolution is not the important variable - it's browser viewport width. You
can set MANY different viewport widths on a given resolution/size screen.
One, or more, of those widths may cause you problems.


It will if you use a single outer table with a fixed width, and set to
center align.

--
Murray
--------------
MVP ExpressionWeb









- Show quoted text -

Thank you for the answer.

Please remember that I want to place a white body on a grey background
and the background must fill the whole screen and the body must be
centerd.
 
Create the page and set the back ground color.
Create the table and center it.
Set the background color of the table to white.

Here's an example, copy and paste onto a new empty page in code view.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>sample page</title>
<style type="text/css">
body {
background-color: #C0C0C0;
}
..table1 {
background-color: #FFFFFF;
margin: auto;
width: 720px;
}
</style>
</head>

<body>

<table class="table1">
<tr>
<td>&nbsp;</td>
</tr>
</table>

</body>

</html>

--

Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm
 
I remembered that. It's really quite easy using the methods others have
described here.

The page background color is gray. The table's background color is white.
 
Back
Top