centering problem
http://www.hampton-homes.net/homes/Fairmont.php
I looked at this page with IE 5.5 on WinMe and it looks right. The text to the right of the house is justified left, as is the small disclaimer on the very bottom. But I'm now looking at it on IE 6.0 on Win2K and the text to the right of the house and the disclaimer text is now centered. I don't understand how it would be centered in IE 6.0 but not 5.5. (The code validates) What am I missing here?
Thanks in advance.
kb posted this at 20:00 — 30th June 2003.
He has: 1,380 posts
Joined: Feb 2002
i'm not sure i understand your problem, whether you want it centered or not, but if you DON'T want it centered, heres the reason why it is
<center><table border="0" cellpadding="0" cellspacing="10">
<tr valign="top"><td>
<img src="/homes/pics/Fairmont.jpg" width="300" height="200" align="right" alt="Hampton Homes - The Fairmont" />
</td>
<td class="bold">
<center><img src="/homes/titles/Fairmont.gif" width="190"
height="35" alt="Fairmont" /></center>
• 2-Story<br />
• 2448 sq.ft.<br />
• 4 BR / 2½ BA
</center>
you open up the "center" tag and then another one inside of it, and dont close the first until after the table. that will make EVERYTHING centered. by the way, you should't use "center" tags. they are only supported by IE, i believe. you should use the "div" tag with the "align=center" attribute. plus, if you are looking to get up-to-date, you should use style sheets to position things, as it is/should be done in the latest standards of the web (XHTML...the convergence of XML and HTML...http://www.w3.org/TR/xhtml1/)
the "center" tag may be why different IE versions are interpreting it differently
fifeclub posted this at 01:37 — 1st July 2003.
He has: 688 posts
Joined: Feb 2001
Well from another post a long while back we were discussing centering a table. I was told that align="center" won't work to center the table itself and that the only way to center a table is by surrounding the entire table with center tags.
The center tags in the middle don't need to be in there, but I they are properly both inside the outer center tags, so it should be fine. There are no unclosed tags so all of this should be no problem. Right?
Suzanne posted this at 03:04 — 1st July 2003.
She has: 5,507 posts
Joined: Feb 2000
Whoever told you that is on glue, lol. align="center" is valid up to xhtml 1.0 transitional (I think -- at least html 4.01), and is recommended over or even dafter, ...
Renegade posted this at 09:39 — 1st July 2003.
He has: 3,022 posts
Joined: Oct 2002
works and so does:
table {
margin:0px auto 0px auto;
}
fifeclub posted this at 14:30 — 1st July 2003.
He has: 688 posts
Joined: Feb 2001
Thanks. Got that one working.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.