Saturday, April 4, 2009

Am I valid?

Or more specifically does my website pass the W3C validator check? Absolutely no idea. I got the following message when I tried:

"Sorry, I am unable to validate this document because its content type is image/pjpeg, which is not currently supported by this service. "

Then I noticed there was an option to directly copy in the HTML code and validate it rather than uploading the file..... and it worked!

"Result: 3 Errors, 2 warning(s)"
and specifically:

1 & 2 were both - "required attribute "ALT" not specified "

3 was - "Attribute "COLOR" is not a valid attribute. Did you mean "color"? "

The first two lines with error messages were displaying a picture. I had three pictures in the page and the only one without an error was:
< img height="101" alt="My Chef" src="chef.gif" width="130" / >

This leads me to think that unless the alt command is included it will come up as an error in the validator. I'm assuming this is the case as the validator is checking it will work for all browsers? Given the alt part is to display those words if the browser can't display images this seems like a reasonable guess to me.

The third error was one that I found a little harder to guess at the reason for.
  • I tried to see if it was the actual colour selected by changing it to one from a line with no error message. The message still came up when I ran it again.
  • I compared it to the three lines next to it that were similar, just with different colours... and as far a my human eye could tell they were all formatted and set out exactly the same.
  • I tried deleting the part that said color="#ffff99" and the message went away...... interesting...
  • and them I remembered reading in the tutorial that not all browsers can display colour for the horizontal lines <hr /> command.....

All the problems that it picked up were related to the page display issues. As such I have concluded that the validator will display an error for anything that will not work across all browser platforms.

No comments:

Post a Comment