SEM Blog: Website Marketing Blog » Does Your Site Validate?

Does Your Site Validate?

Posted by Linda at April 18th, 2008

If someone asked “does your site validate” would you know what they meant? If not, now is the perfect time to find out. Site validation is a process which makes sure your web page is coded “by the rules”. There are many rules to composing web code and if you don’t follow them you could end up in a lot of hot water.

By ensuring that your code is setup properly you increase the chances of your pages loading properly in a variety of web browsers and search engines. Bad code can cause a lot of strange symptoms so it’s always best to make sure your code validates. Many webmasters, including myself, have wasted countless hours stumped with problems caused by bad code.

Although validating your pages may sound complicated it’s actually a pretty simple process. The first step is to open the W3C Validation (http://validator.w3.org) and put in the address of the page you want to check. More than likely when you hit the “Check” button you ended up at a page saying something like, “Failed validation, 16 Errors”. Don’t fret; it’s not unusual for a web page to fail the first validation check.

Scroll down and you’ll find an itemized list and description of the various errors W3C found. Many of these errors are self explanatory and easy to fix. You’ll notice that W3C is kind enough to tell you which line your errors occurred on. Make sure you have an editor which shows line numbers.

In my experience many errors are caused by using the wrong type of element for the doctype you’re using. For example, you can’t use HTML code in a XHTML document. Another common problem is when you’ve accidentally nested elements incorrectly such as : (h1)(a href)text(/h1)(/a). This is called ‘tag nesting’ and must be done properly so your code is easily understandable by all browsers. This code should read (h1)(a href)text(/a)(/h1).

There is another variety of error W3C will spit out and that’s the type which makes no sense at all. When you encounter W3C errors which you haven’t the slightest clue about try copy and pasting the error into Google, and someone will likely have a solution. So many people use W3C that any mysterious errors you come across have probably already been solved by other people.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages. Digg del.icio.us Facebook Google Live Reddit StumbleUpon Technorati

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>