Select Page

The Technology and Computing Tips site is currently under going some minor changes and update. While at it, I also put it under the XHTML Validation at W3C. After a few rounds of error corrections and revalidations, here I present you with the results – The 5 Most Common Errors Found in XHTML Validation.

What is Validation

Before we dive into the errors, lets first take a brief look at what XHTML Validation is. Notice that it’s XHTML and not HTML which is validated. So, in order to be validated, your web page needs to first be in XHTML and not HTML. XHTML is the proposed successor to the famous HTML which the web is built on. In short, XHTML is basically HTML that conforms to a valid XML syntax.

Technology And Computing Tips ValidatedThere are many forms or versions of XHTML. XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset and XHTML 1.1. Your web page will have to validate against any one of the XHTML versions mentioned. Kodeexii.Net – Technology Tips was validated against XHTML 1.0 Transitional. That is probably the most widely used validation standards used right now for normal users.

Why Validate?

Yes, your web pages will probably look and be served just fine right now without validating. So why should you validate?

Browser compatibility is one of the reasons for validation. A valid XHTML page stands a higher percentage of being compatible with all the current and future browsers. Your pages will, to a certain extent, be displayed correctly according to the specified standards in all conforming browsers. In a way, by conforming and validating your pages to standards, your pages have a better chance to withstand the test of time.

Many of you are probably trying to earn some dollars with your web pages. If so, than it is important that your pages are liked by the search engines. Here’s a tip – Search Engines like Google and Yahoo! loves a page that conforms to standards. Why so?

As mentioned previously, a validated XHTML page means the page conforms to standards. Search Engines use software programs to crawl and index your pages. Thus, a validated page allows the search engine’s crawlers to easily traverse through your pages and indexing them as these programs are coded according to the standards themselves.

So, if you are trying to make some dollars with your web pages, it’s probably time to validate your pages then. Why don’t you? It doesn’t cost you anything.

The 5 Common Errors in XHTML Document

These are the errors which was encountered when Kodeexii.Net – Computing Tips was validated.

1. Not encoding the ampersand (&) in your pages

Not Valid: <title>Technology, Sports & Whatever</title>
Valid: <title>Technology, Sports & Whatever</title>

Not Valid: <a href="index.php?page=technology&style=5">Technology-Tips</a>
Valid: <a href="index.php?page=technology&style=5">Technology-Tips</a>

2. Not ending img and br tags with />

Not Valid: <br>
Valid: <br /> or <br/>

Not Valid: <img src="http://imagepath" alt="Description">
Valid: <img src="http://imagepath" alt="Description" />

3. Not using alt attribute in img tags

Not Valid: <img src="http://imagepath" />
Valid: <img src="http://imagepath" alt="Description" />

4. Not using quotes around attribute values

Not Valid: <a href= title=Title/>URL</a>
Valid: <a href="" title="Title"/>URL</a>
Valid: <a href='' title='Title'/>URL</a>

5. Not using type in script tags

Not Valid: <script src="/script.js"></script>
Valid: <script type="text/javascript" src="/script.js"></script>

There you are. The 5 common errors in an XHTML page, as discovered when validating Technology And Computing Tips. I hope you get to use them to your benefit. Go on, take a brief look at your web pages. See if you’ve got any of the Not Valids in your pages. Chances are, you’ve probably got a handful of them. Correct them and then try validating your pages.

How To Validate

If you’ve never validated your pages before and would like to validate your entire site, you’re in for a lengthy validation work. Validation is performed on page by page basis. Yes, you need to validate your pages one at a time. However, if you are using a CMS like tool to build your pages, your pages are probably built upon a template. As such you can just validate a couple of pages and assume that the rest are also valid.

There are many validation tools on the net. I just use the W3C Markup Validation Service. You can use any of the many validation services and tools. Just get your pages validated.

Should you now be interested in learning more about XHTML and Validations, there is an extensive XHTML documentation in Wikipedia.

Upon validation, if your page returned a valid result, you get to put on the page this particular button, if you wish to do so. Of course, you can just keep it to yourself.

Valid XHTML 1.0 Transitional