Why Should I Validate? Google Doesn't!

2009-09-08 - Google doesn't validate so why should I waste my time validating?

I've heard that type of response from too many people over the years. And you know what? I'm tired of hearing that as an excuse for ignoring website validation and adherence to protocols. Let's see if we can figure out why a forward thinking technical giant like Google cannot get their home page to validate.

Why Doesn't Google.com Validate (according to W3C)?

2009-09-16 - Michael Thingmand from Denmark asks: Why doesn't google.com validate (according to W3C)?

Table of Contents

  1. HTML Validation Errors - Group Error Messages by Type
  2. So, Why Doesn't Google Validate?
  3. Your Thoughts?

HTML Validation Errors - Group Error Messages by Type

As of 2009-09-08 at 06:00, Google's home page has 39 Errors and 2 Warnings.
URI Short: http://Twuna.com/V/Google (Option Selected: Group Error Messages by Type)

Errors 1 through 7 refer to invalid attributes being used on the <body> Element. Google is validating against an HTML5 DOCTYPE and these attributes have long been deprecated in favor of CSS. Can someone give me a valid reason why Google still utilize this method?

Note: I've kept the Error reasons intact. I have reformatted the actual code example for each Error so you can easily see what the W3 Validator is flagging as an error. Since Google remove all white space within HTML, you'll see ALL error references at Line 7, note the column numbers.

Back to Previous

Line 0, column 0: Using windows-1252 instead of the declared encoding iso-8859-1.

  1. Line 7, column 956: Attribute bgcolor not allowed on element body at this point.

    <body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 topmargin=3 marginheight=3>

  2. Line 7, column 956: Attribute text not allowed on element body at this point.

    <body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 topmargin=3 marginheight=3>

  3. Line 7, column 956: Attribute link not allowed on element body at this point.

    <body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 topmargin=3 marginheight=3>

  4. Line 7, column 956: Attribute vlink not allowed on element body at this point.

    <body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 topmargin=3 marginheight=3>

  5. Line 7, column 956: Attribute alink not allowed on element body at this point.

    <body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 topmargin=3 marginheight=3>

  6. Line 7, column 956: Attribute topmargin not allowed on element body at this point.

    <body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 topmargin=3 marginheight=3>

  7. Line 7, column 956: Attribute marginheight not allowed on element body at this point.

    <body bgcolor=#ffffff text=#000000 link=#0000cc vlink=#551a8b alink=#ff0000 topmargin=3 marginheight=3>

    What you are viewing above is a cascade of errors ALL occurring from the <body> Element which is the first group of errors encountered. These are all Deprecated HTML Attributes which have long been replaced by CSS. They do not exist in the HTML5 Attributes, Google use an HTML5 DOCTYPE.

    Suggested Corrective Actions for <body>

    The following CSS equivalents are usually the recommended replacements for the above 7 HTML errors. The topmargin and marginheight attributes were inline presentation kludges to deal with an IE/Netscape ongoing proprietary code battle, back then. This is now!

    Note: Internet Explorer supports topmargin, leftmargin, bottommargin, and rightmargin attributes. Netscape Navigator supports marginheight and marginwidth attributes on the <body> Element.

    body {
    margin: .3em;
    padding: 0;
    color: #000;
    background: #fff;
    }

    a:link {
    color: #00c;
    }

    a:visited {
    color: #551a8b;
    }

    a:active {
    color: #f00;
    }

  8. Line 7, column 1068: Element nobr not allowed as child of element div in this context. (Suppressing further errors from this subtree.)

    <div id=gbar>
    <nobr>
    <a href="">Web</a>
    <a href="">Images</a>
    <a href="">Videos</a>
    <a href="">Maps</a>
    <a href="">News</a>
    <a href="">Shopping</a>
    <a href="">Gmail</a>
    <a href=""><u>more</u> &raquo;</a>
    </nobr>
    </div>

    DTD NOTE: The only DTD to include this element is the Internet Explorer 3.0 DTD - It incorrectly treats it as a stand-alone element even though both Netscape's original description and observed behavior for both Internet Explorer and Netscape show it is definitely a container element.

    Suggested Corrective Actions

    Utilize a CSS1 Property and apply it to the applicable #gbar CSS Rule(s).

    #gbar {
    white-space: nowrap;
    }

  9. Line 7, column 1135: &amp; did not start a character reference. (& probably should have been escaped as &amp;)

    Invalid: <a href="http://images.google.com/imghp?hl=en&tab=wi" class=gb1>Images</a>

    Valid: <a href="http://images.google.com/imghp?hl=en&amp;tab=wi" class=gb1>Images</a>

  10. Line 7, column 1204: &amp; did not start a character reference. (& probably should have been escaped as &amp;)

    Invalid: <a href="http://video.google.com/?hl=en&tab=wv" class=gb1>Videos</a>

    Valid: <a href="http://video.google.com/?hl=en&amp;tab=wv" class=gb1>Videos</a>

  11. Line 7, column 1276: &amp; did not start a character reference. (& probably should have been escaped as &amp;)

    Invalid: <a href="http://maps.google.com/maps?hl=en&tab=wl" class=gb1>Maps</a>

    Valid: <a href="http://maps.google.com/maps?hl=en&amp;tab=wl" class=gb1>Maps</a>

  12. Line 7, column 1347: &amp; did not start a character reference. (& probably should have been escaped as &amp;)

    Invalid: <a href="http://news.google.com/nwshp?hl=en&tab=wn" class=gb1>News</a>

    Valid: <a href="http://news.google.com/nwshp?hl=en&amp;tab=wn" class=gb1>News</a>

  13. Line 7, column 1417: &amp; did not start a character reference. (& probably should have been escaped as &amp;)

    Invalid: <a href="http://www.google.com/prdhp?hl=en&tab=wf" class=gb1>Shopping</a>

    Valid: <a href="http://www.google.com/prdhp?hl=en&amp;tab=wf" class=gb1>Shopping</a>

  14. Line 7, column 1492: &amp; did not start a character reference. (& probably should have been escaped as &amp;)

    Invalid: <a href="http://mail.google.com/mail/?hl=en&tab=wm" class=gb1>Gmail</a>

    Valid: <a href="http://mail.google.com/mail/?hl=en&amp;tab=wm" class=gb1>Gmail</a>

  15. Line 7, column 1582: The u element is obsolete.

    Invalid: <a href="http://www.google.com/intl/en/options/" class=gb3><u>more</u> &raquo;</a>

    Valid: <a href="http://www.google.com/intl/en/options/" class=gb3>more &raquo;</a>

    Note: I have to wonder why the obsolete <u> element is being used to underline an anchor element which is already underlined by default? This one escapes me. All I did was remove the <u></u> element to make it valid. Can someone please explain this one to me, what am I missing?

  16. Line 7, column 1640: Attribute width not allowed on element div at this point.

    Invalid: <div id=guser width=100%><nobr>

    Suggested Corrective Action for width

    Utilize a Width Property and apply it to the applicable #guser CSS Rule(s).

    #guser {
    width: 100%;
    }

  17. Line 7, column 1646: Element nobr not allowed as child of element div in this context. (Suppressing further errors from this subtree.)

    Invalid: <div id=guser width=100%><nobr>

    Suggested Corrective Actions for <nobr>

    Utilize a CSS1 Property and apply it to the applicable #guser CSS Rule(s).

    #guser {
    white-space: nowrap;
    }

  18. Line 7, column 1665: &amp; did not start a character reference. (& probably should have been escaped as &amp;)

    Invalid: <a href="/url?sa=p&pref=ig&pval=3&q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg">iGoogle</a>

    Valid: <a href="/url?sa=p&amp;pref=ig&amp;pval=3&amp;q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&amp;usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg">iGoogle</a>

  19. Line 7, column 1673: &amp; did not start a character reference. (& probably should have been escaped as &amp;)

    Invalid: <a href="/url?sa=p&pref=ig&pval=3&q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg">iGoogle</a>

    Valid: <a href="/url?sa=p&amp;pref=ig&amp;pval=3&amp;q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&amp;usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg">iGoogle</a>

  20. Line 7, column 1680: &amp; did not start a character reference. (& probably should have been escaped as &amp;)

    Invalid: <a href="/url?sa=p&pref=ig&pval=3&q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg">iGoogle</a>

    Valid: <a href="/url?sa=p&amp;pref=ig&amp;pval=3&amp;q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&amp;usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg">iGoogle</a>

  21. Line 7, column 1733: &amp; did not start a character reference. (& probably should have been escaped as &amp;)

    Invalid: <a href="/url?sa=p&pref=ig&pval=3&q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg">iGoogle</a>

    Valid: <a href="/url?sa=p&amp;pref=ig&amp;pval=3&amp;q=http://www.google.com/ig%3Fhl%3Den%26source%3Diglk&amp;usg=AFQjCNFA18XPfgb7dKnXfKz7x7g1GDH1tg">iGoogle</a>

  22. Line 7, column 1891: &amp; did not start a character reference. (& probably should have been escaped as &amp;)

    Invalid: <a href="https://www.google.com/accounts/Login?hl=en&continue=http://www.google.com/">Sign in</a>

    Valid: <a href="https://www.google.com/accounts/Login?hl=en&amp;continue=http://www.google.com/">Sign in</a>

  23. Line 7, column 2025: The center element is obsolete.

    <center><br clear=all id=lgpd>

    Suggested Corrective Actions for <center>

    There are various CSS methods to achieve centering, utilize one or more of them and eliminate the obsolete <center> elements.

  24. Line 7, column 2047: Attribute clear not allowed on element br at this point.

    <center><br clear=all id=lgpd>

  25. Line 7, column 2149: &amp; did not start a character reference. (& probably should have been escaped as &amp;)

    <img alt="Google" height=110 src="/intl/en_ALL/images/logo.gif" width=276 id=logo onload="window.lol&&lol()">

  26. Line 7, column 2229: Attribute cellpadding not allowed on element table at this point.

    <table cellpadding=0 cellspacing=0>

    Suggested Corrective Actions for cellpadding

    Utilize CSS to control presentation of <table> elements e.g.

    #foo table {
    margin: 0;
    padding: 0;
    border-collapse: collapse;
    }

  27. Line 7, column 2229: Attribute cellspacing not allowed on element table at this point.

    <table cellpadding=0 cellspacing=0>

    Suggested Corrective Actions for cellspacing

    Utilize CSS to control presentation of <table> elements e.g.

    #foo table {
    margin: 0;
    padding: 0;
    border-collapse: collapse;
    }

  28. Line 7, column 2244: Attribute valign not allowed on element tr at this point.

    <tr valign=top>

    Suggested Corrective Actions for valign

    Utilize CSS to control presentation of <tr> elements e.g.

    #foo tr {
    vertical-align: top;
    }

  29. Line 7, column 2258: Attribute width not allowed on element td at this point.

    <td width=25%>

    Suggested Corrective Actions for width

    Utilize CSS to control presentation of <td> elements e.g.

    #foo td {
    width: 25%;
    }

  30. Line 7, column 2293: Attribute align not allowed on element td at this point.

    <td align=center nowrap>

    Suggested Corrective Actions for align

    Utilize CSS to control presentation of <td> elements e.g.

    #foo td {
    text-align: center;
    }

  31. Line 7, column 2293: Attribute nowrap not allowed on element td at this point.

    <td align=center nowrap>

    Suggested Corrective Actions for nowrap

    Utilize CSS to control presentation of <td> elements e.g.

    #foo td {
    white-space: nowrap;
    }

  32. Line 7, column 2679: Attribute nowrap not allowed on element td at this point.

    <td nowrap width=25% align=left>

    Suggested Corrective Actions for nowrap

    Utilize CSS to control presentation of <td> elements e.g.

    #foo td {
    white-space: nowrap;
    }

  33. Line 7, column 2679: Attribute width not allowed on element td at this point.

    <td nowrap width=25% align=left>

    Suggested Corrective Actions for width

    Utilize CSS to control presentation of <td> elements e.g.

    #foo td {
    width: 25%;
    }

  34. Line 7, column 2679: Attribute align not allowed on element td at this point

    <td nowrap width=25% align=left>

    Suggested Corrective Actions for align

    Utilize CSS to control presentation of <td> elements e.g.

    #foo td {
    text-align: center;
    }

  35. Line 7, column 2693: The font element is obsolete.

    <font size=-2>

    Suggested Corrective Actions for <font>

    Utilize CSS to control presentation of content. The <font> element was a staple from the 90s.

  36. Line 7, column 2733: = in an unquoted attribute value. Probable causes: Attributes running together or a URL query string in an unquoted attribute value.

    Invalid: <a href=/advanced_search?hl=en>Advanced Search</a>

    Valid: <a href="/advanced_search?hl=en">Advanced Search</a>

  37. Line 7, column 2798: = in an unquoted attribute value. Probable causes: Attributes running together or a URL query string in an unquoted attribute value.

    Invalid: <a href=/language_tools?hl=en>Language Tools</a>

    Valid: <a href="/language_tools?hl=en">Language Tools</a>

  38. Line 7, column 2873: The font element is obsolete.

    <font size=-1><a href="/intl/en/ads/">Advertising&nbsp;Programs</a>

    Suggested Corrective Actions for <font>

    Utilize CSS to control presentation of content. The <font> element was a staple from the 90s.

  39. Line 7, column 3045: The font element is obsolete.

    <font size=-2>&nbsp;&nbsp;<a href=/advanced_search?hl=en>Advanced Search</a>

    Suggested Corrective Actions for <font>

    Utilize CSS to control presentation of content. The <font> element was a staple from the 90s.

? So, Why Doesn't Google Validate?

After going through the above validation routine line by line, I'm left wondering why Google have chosen to mix and mash various coding styles while using an HTML5 DOCTYPE. Based on the HTML markup Google have chosen, the HTML 4.01 Transitional DOCTYPE would be more suitable.

Back to Previous

Less Bytes?

You can clearly see where the argument for less bytes comes into play. Yes, there is added size to the overall equation based on the above suggestions. Since I don't fully understand how the Google home page is being dynamically served, some of my observations may not take into consideration the bigger picture. If that is the case, then a different DOCTYPE would be suggested and/or a customized Google DTD.

When I peruse the embedded <style>s within the <head></head> section of Google's home page, I'm left wondering if the Less Bytes argument holds water? Why can't the appropriate CSS properties be added to the embedded <style> element?

Back to Previous
Hippie Robot

Least Common Denominator?

Is it possible that Google is appealing to the absolute least common denominator? Even so, based on my understanding of the specifications and current technologies, I think someone is just holding on to some last minute originality stuff. We know that Google is intent on not changing their home page. I'm guessing that same methodology applies to the code behind the scenes - keep it as original and 90s as possible.

Back to Previous

1990s HTML Markup and HTML5 DOCTYPE?

For a forward thinking technical giant like Google, I'm surprised to find that the thought process at certain levels is still pre 2k when it comes to HTML Markup. I really need someone besides myself and the W3C to help me understand why Google utilize the markup that they do. And, I'd really like to know why an HTML5 DOCTYPE is being used when a notable percentage of the markup is HTML 4.01 Transitional?

Back to Previous

Your Thoughts?

What are your thoughts on why Google doesn't validate? Share them with us on Twitter and we'll see if we can't get an accurate answer to this perplexing question.

Just because Google doesn't validate, doesn't mean you shouldn't. You can't compare your website to Google so why even use them as an example? YOUR website needs every available byte of optimization that you can squeeze out of your HTML markup. Read more about The Importance of Website Validation.

Back to Previous

 

SEO Consultants Directory