HTML Validator

  posted by 'Gregory Gates' on February 14, 2008 at 9:00 pm

This article in a the series discusses the history of HTML, how it spawned XML and then how XML has merged back into HTML creating XHTML. The meat of this article will describe how each HTML page can be validated creating a better web site that is more cross browser capable.

In HTML's past, the browser wars has had many casualties. Most will never remember the first browser create by the University of Illinois called Mosaic. Even the first popular browser Netscape's Navigator is almost lost in history. And one of the first cross platform browsers written in Java called HotJava is lost except through a Google search. The current browsers include Microsoft's Internet Explorer, Apple's Safari, Opera and Firefox all have differences that any web developer must consider.

It is easy to think that a simple HTML based web site should be easily rendered in a browser today, but there are many nuances that become even more apparent when using Style Sheets and JavaScript. There really is not standard for a browser. Enter the HTML validator.

As HTML matured, the famous (or infamous) bracketed HTML statement became the for common form of the XML language. But, unlike XML, HTML still remains loosely enforced unlike the XML. The form of brackets is commonly known while the <HTML /> form is not, except when using <XML />.

In today's HTML world, it is almost a basic requirement ensuring that the rendered HTML conforms to the XML standard. Although this is not enforced by the browser, the HTML pages are still displayed even when they are not conforming, ensuring a web page does conform better guarantees the page is displayed correctly in every common browser used today.

Here are the basic steps ensuring your web pages are validated. Create your web page using lower case style tags, use self terminating tags for <meta />, <br />, <hr /> and <img /> components. Use the 'validator.w3.org' web site to read your HTML page and identify errors. Fix the errors and re-run the validator until no errors are present. View the web page on as many common browsers as possible.

When using the 'validator.w3.org', select to show the HTML source making it easier to identify the line number of the errors present. Each error typically has a help section that will describe the problem and recommended solutions. The validator works on a single web page at a time, run the validator for each web page ensuring the entire site will render correctly in each browser.

There are three levels of HTML. Raw HTML which is the un-validated HTML, transitional HTML, and XHTML strict compliant. Un-validated HTML is the web page that does not do anything this article discusses. Transitional HTML is the web page that uses XML style compliant format but is allowed leeway in the attributes used with the HTML tag. Strictly compliant HTML is XHTML that is ensures meeting all the latest guidelines giving it the best chance of being viewed correctly in each browser.

The validator.w3.org web site has much better documentation about the specifics of validated HTML and the details of what should be done. The validator can also be used to identify broken links which also burdens common web sites. This now extends into the style sheet (CSS) linked into the HTML web page and even the RSS links for bloggers, all should be validated in professional web sites.

The following articles start moving into more details of creating robust web applications using XML, PHP security and Paypal for electronic commerce transactions.
Comments No comments for this entry... Add
2009
2008
2007
2006