Forum Moderators: open
How important is this type of validation?
What are the errors that cause the most problems for google?
I'm not an HTML purist. I just think that anything that's doing, is worth doing well.
The point, correct me if I'm wrong, of HTML is to allow a person to have information displayed the way they want it to be, right? I mean, if layout wasn't important, we'd all have pages of black text on white backgrounds, no? I think that if you're going to go to the trouble of making your information appear how you want it to appear, you might as well make the extra little bit of effort to make SURE it appears as reasonably close to how you want it. But that's just me. Once you start worrying about fancy-dancy HTML/JS/CSS tricks, the medium is becoming more important than the message... and then you might as well throw in six flash animations and streaming music on your pages...
It's a tedious process but as you learn, it becomes second nature.
I think this is definitely true.
Figure out WHY you are not validating, and you will start just writing the good code before long. I think validation is more an issue of having pride in your craft than it is an issue with Google. G-bot is hungry.....it will consume, but validate anyhow to become better at what you do.
I then found out they were using Netscape 4. I checked the site in Netscape 4.8 and found that I had </a</font></p> on the end of the third link on the page. Doh! validation doesn't catch every error, but is a very good start.
There are only about 20 common errors that are regularly made. Once you spot those for what they are, you can fix pages quite quickly. Sometimes the error is some distance from where the typo actually is.
The W3c validator pegs these links as errors because of the fact that ampersand symbols are special html characters. It appears the only way to validate these pages is to use a redirect and put the urls in an htaccess file. Any other ideas would be greatly appreciated.
Ted
Cf. the quirklist for a general approximation of the differences between standards mode and quirks mode rendering: http:// www.mozilla.org/docs/web-developer/quirks/quirklist.html
Jordan
Check that you have the URL correct -- it's easy to miss those &s and ;s and #s when converting to character entities -- as it is possible that you are looking for
.
Here are some of the messages that I regularly post in site reviews at some other forum. They come up every single day. I got fed up with typing the same thing daily, sometimes several messages in a row. Now I just cut and paste the appropriate ones each time, adding specific extra comments only where needed:
Add type="text/javascript" to every <script> tag.
Add a type="text/css" attribute to every <style> tag.
All <style> tags should be in the <head> section not in the <body>.
Correct the entity errors by changing every & in the URLs to be & instead.
Remember to "Quote" all attributes, especially all "#FFFFFF" colors, all URLs, all "50%" sizes, and any other attribute value that contains anything other than a simple "A" to "Z" or "0" to "9" value. In HTML 4.01 it is recommended to quote all attribute values.
Add alt="some text" to every <img > tag, the text reflecting what is in the dispayed image. On unimportant images, like spacer elements, a minimum of alt="" is fine. For bullet-point images, alt="*" is often used. Search engines do index the alt text. The alt attribute is a required element.
Closing tags never have attributes, so stuff like </font size> </font color> </font face> should each only be </font> instead.
Any id attribute must be unique. If you need to reuse an id you should be using class instead.
Identical adjacent opening tags that each have a separate attribute, like <font size="2"><font color="#FFFFFF"><font face="ariel">, can be combined so that it becomes one tag with several attributes, like <font size="2" color="#FFFFFF" face="ariel"> for example. This then only requires one closing </font> tag, instead of three. However, CSS is now replacing these tags with external stylesheets.
Hide any closing tags like '</td>' that are within document.write statements by either breaking them open '</' + 'td>' or by escaping them <\/td> and the validator will no longer complain about these closing tags. It is important to break directly after the / and not the middle of a word.
Enclose any inline Javascript code inside this sort of <!-- comment // --> tags, and all of the CSS style code, and any other comments within the HTML part, in this sort of <!-- comment --> tag pair. This only applies if you are using HTML code, not XHTML.
It never used to matter if tags used upper or lower case. In HTML 4.01 it is recommended to write all tags and attributes in lower case. For XHTML an XML it then becomes a requirement.
Javascript is best done with external .js files, called using:
<script type="text/javascript" language="javascript" src="/path/file.js"></script>
In CSS you must have units with all of your numbers, so one of either px, pt, em, %, or # is always required.
The four margin errors can be replaced with a little bit of CSS code instead. Put this is a text file, with a name ending in .css:
body {
margin: 0px;
padding: 0px;
}
You should export the CSS to an external file and call it with instructions in the <head> section of the HTML file. Most people use this one, but it can cause problems:
<link type="text/css" rel="stylesheet" src="/path/file.css">
It is better to use this slightly longer version of this, again placed in the <head> section of the HTML file:
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
@import url(path/file.css);
</style>
This version hides the CSS from older versions of Netscape that cannot handle CSS. This stops those versions from displaying a corrupted page with overlapping elements.
External CSS files must not contain any HTML tags or code.
.
Interesting article about XHTML problems as well: [hixie.ch...]