views:

448

answers:

3

Inspired by this and this topic about the fact that Google's homepage isn't validating, just because of performance issues (1 byte less saves gigabytes of data traffic a day), I wondered:

What is the smallest possible HTML-file that renders Google Homepage correctly in at least one browser?

By Google Hompage I mean the most simple version of it, without Javascripts and the top menu et cetera: Google Homepage

Requirements and info:

  • The HTML-file must include the <title>
  • You may not load external files, except the Google Logo
  • It's about the size of the HTML-file, not the size of the Google image logo
  • Available languages: HTML, CSS and Javascript
+10  A: 
<meta http-equiv="refresh" content="0;url=http://google.com/" />
leppie
That's unfair... I'll add another requirement which says that you may not load external source, except the logo.
Harmen
Very funny, leppie. :P
Mike Daniels
Pfft, you could have saved lots of bytes on quotes and the terminating ` /` (both of the URL and the `meta` tag).
Thomas
+4  A: 

The following (verbatim) takes advantage of the fact that some browsers are mega smart about poorly formatted/incomplete html. I just didn't bother with html, head, or body tags. I did, per your requirements, include "title". I didn't bother with anything other than html.

The logo is exactly the same as the dimensions of today's logo. I did this by a google image search, specifying the width/height specified in the style attribute of the (thank you FireBug for saving me from the horrible source code).

I used bt.ly to shorten URLs.

<title>Google
<center>
<form action=http://bit.ly/Afziu&gt;
<img src=http://bit.ly/bThoDE&gt;&lt;br&gt;
<input name=q><br>
<input type=submit value="Google Search">
<input type=submit onclick=this.checked=1 value="I'm Feeling Lucky" name=btnI>

If, stylistically, you want a closer fit, let me know. Also, if valid html is required, I can do that to. When character counting, assume that there is no whitespace. I left it in so you could see my technique.

To beat this, competitors could find a way of breaking up the lines without using the two "br" tags.

This was tested with Firefox 3.6.8 on Ubuntu Lucid. Thanks for the interesting challenge :-).

Octoberdan
I don't deserve this yet. I just realized that the "I'm Feeling Lucky" button only works when input is empty.
Octoberdan
Not to mention all that whitespace! And, the question about whether we're assuming we're on Google's site or not. That action attribute could be shortened to `search` if so.
Mike Caron
I mention that whitespace should be removed when counting. Also, I don't like making assumptions that I can't test ;-)
Octoberdan
I suppose if Google were to use this, they could go with their own http://goo.gl/ URL shortner and maintain performance.
Dolph
Haha, I like the onclick=this.checked=1 attribute ;)
Harmen
You could remove these <br>s by adding a <pre> tag right after <form>, but then new lines are counting as characters, I guess.
Harmen
Yeah, the onclick was a quick hack to get the IFL working again.
Octoberdan
@Harmen, they may be counting as characters but they are needed characters... and better than two <br>. Thanks for the suggestion!
Octoberdan
bit.ly seems to be discarding the query string, so this doesn't work for me!
Ryan Tenney
Strange! I wonder if something went wrong with my testing as it worked for me. Oh well. The game is over, the victor has been named.
Octoberdan
You should use `goo.gl/e`
M28
+10  A: 
<title>Google
<center><form action=//google.us/search>
<img src=//google.us/images/logo.png>
<p><input name=q>
<p><button>Google Search</button><button name=btnI>I'm Feeling Lucky

175B

  • http: can be ommitted, assuming that we deploy it via HTTP.
    • Let's not use bit.ly for now--finding a better shortener can be done later.
  • <p> over <br>.
  • <button> over <input type=submit>.

Should work on Fx3.6 at least.

matyr
I am discomfited by a worthy opponent and a lack of htmlfu!Why not use a URL shortener to cut down on the action and src values?Awesome with the "//". I didn't know one could do that!
Octoberdan
+1 for dropping off http:, and (if I could) another +1 for `<button>` I didn't realize it could take the place of `<input type=submit>`.
Ryan Tenney
You could shave a few characters by using Yahoo instead of Google.
Joey Adams
Why "//google.us/search" instead of "search"? Hell, the question is about *rendering* only, why not "s"?
Roger Pate