View Full Version : W3C Validation Errors

02-17-2005, 10:49 AM
Hey folks...

Well i started with an amazing 29 W3C errors when i checked with their validator but there are some errors i cannot work out what it doesn't like or i just don't know what it's saying to me :confused:

Would someone please enlighten me as to what the following means please?

Below are the results of attempting to parse this document with an SGML parser.

1.Line 88, column 67: an attribute value must be a literal unless it contains only name characters

...lign=center cellpadding=10 cellspacing=0 width=100%><tr>

You have used a character that is not considered a "name character" in an attribute value. Which characters are considered "name characters" varies between the different document types, but a good rule of thumb is that unless the value contains only lower or upper case letters in the range a-z you must put quotation marks around the value. In fact, unless you have extreme file size requirements it is a very very good idea to always put quote marks around your attribute values. It is never wrong to do so, and very often it is absolutely necessary.

2. Line 91, column 28: there is no attribute "VALIGN"

<font color="333333" valign="top" width="50%">

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.

3. Line 91, column 40: there is no attribute "WIDTH"

<font color="333333" valign="top" width="50%">

4. Line 132, column 23: an attribute value must be a literal unless it contains only name characters

<td valign=top width=33%>

5. Line 151, column 67: an attribute value must be a literal unless it contains only name characters

...lign=center cellpadding=10 cellspacing=0 width=100%><tr>

6. Line 154, column 40: an attribute value must be a literal unless it contains only name characters

<font color="333333" valign=top width=50%>

Many Thanks!

02-17-2005, 11:23 AM
Although there should be enough hints in there to tip you off, here's the explanation in "non-W3C-speak":

1. It's good practice to always put attribute values in quotes:

align="center" cellpadding="10" cellspacing="0" width="100%" Appearently, somewhere in there is an attribute value for which it is necessary (I guess the align and width attributes).
Just always use quotes and you'll be laughing.

2. The font element has no valign attribute; AFAIK, only the td and th elements do.

3. Same as 2, only this time it's the width attribute that's out of place.

4. and 5: quotes again.

6. Quotes, and wrong attributes (see 2. and 3.)

02-17-2005, 11:30 AM
Hi there Xko,


...lign="center" cellpadding="10" cellspacing="0" width="100%"><tr>
2. & 3.

<font color="333333" valign="top" width="50%">
Apart from the fact that 'font' is a deprecated element - (replace it with CSS) -, valign and width
are not attributes of this tag and are therefore meaningless. :eek:

4. & 5.

require the same action as 1.


requires the same action as 2. & 3.


ooops, sorry Ronald, didn't notice your post when I started on mine :D

02-17-2005, 11:37 AM

Good to see though that you've corroborated my findings... :thumbsup:

02-17-2005, 11:40 AM
Hi there Ronald,

great minds think alike ;)


02-17-2005, 11:40 AM
:thumbsup: Thanks both! I done what you suggested as we're 99% there.

The only problem i have now is as follows...

No Character Encoding Found! Falling back to UTF-8.

I was not able to extract a character encoding labeling from any of the valid sources for such information. Without encoding information it is impossible to reliably validate the document. I'm falling back to the "UTF-8" encoding and will attempt to perform the validation, but this is likely to fail for all non-trivial documents.

Now that does go straight over my head!

02-17-2005, 11:47 AM
Hi there Xko,

you need something like this in the head section...

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


02-17-2005, 11:56 AM
Sweet, thanks again you guys!

Now i just have to sort the rest of the pages out... :D

Thanks again!