PDA

View Full Version : html code such as center


hornstar6969
Fri 22nd Sep '06, 1:48am
I just ran a css validator and it told me ive got 37 errors on my site.

So im now going to start fixing them up.

Things like the <center> tag appear to not be standard anymore? is this correct?

Should I use this instead

<p style="text-align: center;">
All text in here will be centered
</p>


The only problem is that it uses a lot more text space, and forum titles cant be to long or they get cut off, so im waiting on feedback for that question in another thread as well.

But how important is it I change this?

Or is it bad to have too much html in spots like this where search engines may prefer the text instead of all the html?

Thanks.

Colin F
Fri 22nd Sep '06, 3:38am
The validators validate according to guidelines.
In 99% of the cases your site will run fine if you're using <center> too.

nico_swd
Fri 22nd Sep '06, 4:38am
The <center> tags is not supported in XHTML 1.0 strict. If you want your code to pass the validation then use CSS or another doctype.

MRGTB
Fri 22nd Sep '06, 6:11am
Well I use <center>bla bla</center> and my site validates to W3C XHTML 1.0. And I use it in quite a few places to in my custom left side block in moduals on my forumhome page. I get all green and 100% validate.

But you can use align="center"

nico_swd
Fri 22nd Sep '06, 6:21am
Note that there are different types of XHML 1.0, such as Strict, Basic, Transitional, ... etc.
I think only XHTML 1.0 strict doesn't support it.

MRGTB
Fri 22nd Sep '06, 6:33am
Oh right, do you have a link to run my forumhome page through the strict validate. So I can see the results of my site using the <center> tag

nico_swd
Fri 22nd Sep '06, 6:38am
http://validator.w3.org/

Once submitted the URL you can select the Doctype and revalidate.

MRGTB
Fri 22nd Sep '06, 6:43am
Yeah, I see your point. While my forumhome validates 100% as transitional. It as 150 errors as strict. LOL

dear me!

hornstar6969
Sun 24th Sep '06, 7:49am
Yeah, I see your point. While my forumhome validates 100% as transitional. It as 150 errors as strict. LOL

dear me!

rofl, Thought mine was bad at 38 :D ive now got it down to 19 but still got a bit more to go.

MRGTB
Sun 24th Sep '06, 8:37am
Well, as long as my site looks fine in IE and Firefox (which is does). And is OK with W3C Transitional and is CSS valid. I'm not bothererd about the the strict W3C validate.

Also just re-tested the site with strict and only got 43 errors this time.

Zachery
Sun 24th Sep '06, 4:50pm
As long as your site looks fine cross browser do not worry so much about validation.

Chousho
Sun 24th Sep '06, 5:37pm
the center tag
<center>blah</center>

is also depreciated, which means it works, but is set to be deleted (aka - is now archaic) in future versions of *html. I haven't read up on it in a while, so if anyone has anymore info, put it in.

As the replacement, it's better to use the CSS code of

.blah {
text-align: center;
}

which works almost just like center.

Also, the same can be said for the <font> tags. It's better to use CSS for these things, unless it's too much a hassle for you to edit, or etc.

However, like said, if it doesn't validate 100%, but it works, don't sweat it too much.

hornstar6969
Mon 25th Sep '06, 7:54am
yeah my plan is to slowy make it compliant more and more, and as long as its looking good im happy. im now down to 5 errors ^^