61

I was looking at the www.google.com in Firebug and noticed something odd: The Google logo is centered using a center tag.

So I went and checked the page with the W3C validator and it found 48 errors. Now, I know there are times when you can't make a page valid, especially when we're talking about something like www.google.com and you want it to be as small as possible, but can someone please explain why they use the center tag?

user2864740
  • 60,010
  • 15
  • 145
  • 220
Adrian Mester
  • 2,523
  • 1
  • 19
  • 23

9 Answers9

59

I attended a panel at SXSW a few years ago called "F*ck Standards" which was all about breaking from standards when it makes sense. There was a Google engineer on the panel who talked about the Google home page failing validation, using deprecated tags, etc. He said it was all about performance. He specifically mentioned layout rendering with tables beating divs and CSS in this case. As long as the page worked for their users, they favored performance over standards.

This is a very simple page with high traffic so it makes sense. I imagine if you're building a complex app that this approach might not scale well.

From the horse's mouth.

Alex Bilstein
  • 606
  • 5
  • 3
13

Because it's just the easiest, most concise way to get the job done. <center> is deprecated, for sure, but as long as it's still supported, you're likely to still see them using it.

Chris Tonkinson
  • 13,823
  • 14
  • 58
  • 90
10

Shorter than margin:0 auto. Quicker to parse. It is valid HTML4. No external dependencies, so less HTTP requests.

Rich Bradshaw
  • 71,795
  • 44
  • 182
  • 241
8

Usability is NOT validity.

Google Search's biggest achievement has been to build a site which is easy to use, and can be widely used. Now, if Google achieved this with a page which does not validate, well, there's a lesson there to learn.

TFM
  • 544
  • 5
  • 11
4

I think a better question to ask would be "why would Google make it validate if it works fine?" It makes no difference to the user.

Tom Dalling
  • 23,305
  • 6
  • 62
  • 80
4

There has been speculation and discussion about whether this is intentional; the basic test carried out in the first link does result in a smaller page, and even gzipped, through millions of page views it theoretically stacks up. I doubt that's the reason though: it was created, tested on many browsers at the time, it worked, and continues to work.

Alistair Knock
  • 1,806
  • 2
  • 16
  • 25
4

Google's breaks validation in many ways on their home page. The very likely real reason - they are all about speed and bandwidth costs. Look at the size of the home page HTML particularly after Gzip is applied at the packet level. They are clearly trying to avoid packet fragmentation (which will mean more bandwidth) and willing to do whatever it takes to get it (identifier shortening, quote removal, deprecated tags, white space removal, etc.

If you look at this just as a validity question, fine but they break the rules on purpose if you don't assume this of course you may jump to a negative conclusion. BTW you can further optimize their pages both in positive and negative manners but why once inside the typical packet size it is somewhat pointless.

0

They also use other deprecated presentational tags like font and u. My guess is it makes the page quicker to load then using an external stylesheet and allows it to work on more platforms.

Andrew Marsh
  • 2,032
  • 15
  • 14
  • they do use some css inside the document. maybe it's shorter to write the font tags? – Adrian Mester Jun 24 '09 at 13:23
  • I'm going to assume that it's probably to work around obscure browser errors. It could alternatively be a way of making the file size smaller as once in the body is less characters than defining it in the inline style and then using something like around the uses of that font size. Especially as each font size tag is only used once. – Andrew Marsh Jun 24 '09 at 13:42
0

It's deprecated, sure, but I think simplicity is the answer to your question.

CoolBeans
  • 20,654
  • 10
  • 86
  • 101
natas
  • 183
  • 9