centering web site pages

B

Brian Cryer

Lee said:
Hi,

I want to create a web site that is centred, something like;-

http://www.xbox-scene.com/

Any ideas how this is accomplished, or are there any editors that can
do
this?

Stick everything inside a div and center that. So something along the lines
of:

<body>
<div style="text-align:center">
<p>Some content ...</p>
</div>
</body>

the site you gave as an example has a fixed width design (860pixels wide),
which means it sticks to the same width regardless of the size of the
browser window. A dynamic design which adjusts to the browser width has a
number of advantages over this (plus some disadvantages).
 
R

Rik

Brian said:
Stick everything inside a div and center that. So something along the
lines of:

<body>
<div style="text-align:center">
<p>Some content ...</p>
</div>
</body>

the site you gave as an example has a fixed width design (860pixels
wide), which means it sticks to the same width regardless of the size
of the browser window. A dynamic design which adjusts to the browser
width has a number of advantages over this (plus some disadvantages).

For a fixed size, I'd:

html, body{
width:100%;
text-align: center; #only necessary for MSIE
}
#page{
width: 760px;
margin: 0 auto;
text-align: left;
}


<body>
<div id="page">
</div>
</body>

Grtz,
 
D

dorayme

Lee said:
Hi,

I want to create a web site that is centred, something like;-

http://www.xbox-scene.com/

Any ideas how this is accomplished, or are there any editors that can
do
this?

try wrapping all in a div with css:

width: 90%;
margin-top: 1%;
margin-left: auto;
margin-right: auto;
margin-bottom: 1%
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top