PDA

View Full Version : Validation of html



rob
21st Jun 2008, 04:07 pm
I cannot get my code to validate on the W3C website because I have 3 meta tags related to search engines.

These have been inserted for the relevant engines to acknowledge my site and track results.

Everyone else appears ok with no errors.

Can I put up that my site is valid even though the results say no?

I want to include an accessibility page but don't want to look like a fraud!

James
21st Jun 2008, 06:10 pm
I think your site is failing validation because you have not used self-closing tags.

For example,

<META name="y_key" content="b51dae87e69cb106" > should be
<META name="y_key" content="b51dae87e69cb106" />

Several of your META tags and LINK REL tags have the "/" missing.

Change them all to self-closing and re-run the validator.

rob
21st Jun 2008, 09:51 pm
Hi

I have already corrected that and it still doesn't work.

the validator is telling me the problem is being found

<META name="y_key" content="b51dae87e69cb106" />

at the point I have made bold

*note I have been using the file upload version of the validator and not the one you can see online at the moment

James
22nd Jun 2008, 09:04 am
I don't think there is anything wrong with that element (I think you can put what you like as a meta as long as it is properly formed). Just my thoughts, could be wrong.

Sometimes I have noticed the actual error can be elsewhere on the page but it has a knock on effect on other, properly formed elements.

But without seeing the code can't be sure.

rob
4th Jul 2008, 08:29 pm
hi James

Do you think you can take a glance at the homepage now?

I have put up the version that is causing me trouble.

Baffled!

Rob

James
5th Jul 2008, 07:54 am
Got it. XHTML is case sensitive, so it's not recognising META. Change it to meta.

See: http://www.w3.org/TR/xhtml1/#h-4.2 which states:

4.2. Element and attribute names must be in lower case

XHTML documents must use lower case for all HTML element and attribute names. This difference is necessary because XML is case-sensitive e.g. <li> and <LI> are different tags.

The validator error report does tell you to check the case, but it's easily missed.

rob
5th Jul 2008, 01:01 pm
thanks James! you would have thought Yahoo would know better than to give us tags in caps!

David
5th Jul 2008, 02:29 pm
You do have to check imported code from all services when you add it to your pages. I've noticed that Google are particularly bad at this.