how do I center my web site

P

Pierre

When I view the Yahoo site, with my brower setting at 1024 X 768 it is
centered right in the middle with equal space on both side; and when I
view it with my setting at 800 X 600 it fills the page perfectly.

How can I achieve this ?
 
I

Ivo

Pierre said:
When I view the Yahoo site, with my brower setting at 1024 X 768 it is
centered right in the middle with equal space on both side; and when I
view it with my setting at 800 X 600 it fills the page perfectly.

How can I achieve this ?

How do they do it? Have you looked at that?
I may be wrong, but I suspect there is no javascript involved in the styling
of said page. You may have better luch at a newsgroup like
comp.infosystems.www.authoring.stylesheets or
comp.infosystems.www.authoring.html, and even more so when you supply a
sample of what you have, what and what you have tried to make it do what is
supposed to do.
HTH
Ivo
 
L

Lasse Reichstein Nielsen

mayur said:
<body bgcolor="#FFFFFF" text="#000000" ><center>
</center>
</body>

Ick! This might not be an HTML/CSS group, but I highly recommend using
CSS for that, and never use the center tag.

<body style="background:black;color:white;text-align:center;">
<div style="width:780px;margin:5px auto;text-align:left;
background:white;color:black;border:1px solid red;">
Some content that is in the centered div.
</div>
</body>

The trick to centering is to have left and right margins of auto. It
won't work in IEs prior to version 6, and then only in standards mode.
For those other IEs, their incorrect treatement of the
text-align-property can be used as a hack to center the div anyway.

/L
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top