Validating Google Custom Search

Finally I am able to have every page passed the XHTML validation.

Previously, one line didn’t validate. It was a code supplied by Google:

<style type="text/css">
@import url(http://www.google.com/cse/api/branding.css);
</style>

This code shouldn’t be in the content area.

I could have the page validated by moving this style link to the <head> section – there’s where it should be. However that would violates the Adsense TOS.

While doing a search I came across this WebMasterWorld Forum when a member discovered the solution after posting about this problem.

Instead of moving the code, the simple solution is to select a different set of code provided by Google; i.e. to opt for the search box that says Note: Watermark requires JavaScript.

Adsense search selection

Sure enough, with this code changed, it now validates.

Tags:
Category: Maintain-Website
Friday, February 26th, 2010 at 1:33 pm

Leave a Reply