By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,700 Members | 1,458 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,700 IT Pros & Developers. It's quick & easy.

how do I center my web site

P: n/a
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 ?
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Ivo
"Pierre" <pf********@sympatico.ca> wrote in message
news:59**************************@posting.google.c om...
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
Jul 20 '05 #2

P: n/a

<body bgcolor="#FFFFFF" text="#000000" ><center>
</center>
</body>
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

P: n/a
mayur <ma********@yahoo.com> writes:
<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
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.