UniNetNews Logo

Let's Unify the Net!

Standards News and Solutions for Web Designers

How Good Will Your Website Look and How Well Will It Function as the Web Evolves?

Author: Jan Hunt

This is an important question because what have historically been acceptable HTML pages (non standards compliant), will no longer function properly (if at all) as the browser agents become more standards compliant and XML centric.

Code to Standards

Coding to standards will ensure that your documents (and applications that use a Web interface) won't fail as the languages for the WWW evolve.

Changing Requirements

Changes in the industry due to the move towards Web standardization and XML have resulted in the requirement that Web documents:

  1. Use the appropriate DOCTYPE Definition (DTD)
  2. Be written in well-formed HTML/XHTML code
  3. Declare the appropriate Character Encoding
  4. Validates to the declared DTD and character encoding.

The Problem

HTML code has became a mix of structural and style tags interspersed with browser specific markup that often:

  1. Is not well-formed (for example, does not include a closing tag for every opening tag or does not have the proper nesting order of the elements) and
  2. does not validate against any of the W3C Document Type Definitions (DTDs).

The DTD and Validation

The DTD has become more important in the move to standards compliance and XML because it states the rules of that markup language. These rules provide details of each element, their order, what attributes they can take and other markup information, such as, if the element is block-level or in-line.

Validation simplifies HTML/XHTML processing because:

  1. The browser does NOT have to be programmed with an innate understanding of all the tags (as they do now), and
  2. the browser does not have to accommodate different possibilities (i.e. error correction) as they do now.

Validation will remove some of the work browsers currently need to do to render a page. As HTML moves into the XML environment, validation will become more important because XML usually requires valid documents.

Questions to ask Yourself

  1. Will your document need to interact with XML languages in the future?
  2. Will your document need to function in varied browsers and browser versions?
  3. What is the projected life span of these documents?

If you answer yes to #1 then you will need to produce documents that are at a minimum, valid against the XHTML 1.0 strict DTD and include the document character encoding. This would also require all the document's formatting be moved into a Cascading Style Sheet (CSS).

If you answer yes to just #2 then your documents will need to be valid HTML (and I suggest HTML 4.01) or XHTML and include the document's character encoding. If the browsers were XML based then the document would have to validate to XHTML 1.0 Strict with style formatting moved into a CSS.

If the document life span is unknown, but possibly long-term, your design and development will be different from a short-term document. You will need to position the document in a manner that minimizes the amount of work you will need to do if you decide to keep it updated to whatever the current standards are as these standards evolve. Your best bet is XHTML. At a minimum, your documents will be well-formed so they will be easier to update to modular XHTML as the related technologies develop. If you can move most of your display formatting code out of the document and into a CSS the document will be much closer to XML requirements, not to mention you will save time during design, development and in maintenance.

If the document's life span were short then valid HTML 4.01 would probably be sufficient.

Summary

Position documents for the future by:

  1. Using either valid HTML 4.01 or
  2. better yet valid XHTML 1.0 (current development tools might not produce valid XHTML but the code can be easily tweaked to comply).
  3. Move as much formatting code as possible, into Cascading Style Sheets.
  4. Using the appropriate DTD.
  5. Declaring the document character encoding.

Tools and Resources

  1. Validate documents using the W3C HTML/XHTML validator.
  2. Homesite Version 5 produces HTML/XHTML compliant code and includes HTML Tidy, which will sweep through a document and make it into XHTML. HTML-Tidy also produces a log to tell you what other modifications need to be made.
  3. The W3C HTML Tidy program http://www.w3.org/People/Raggett/tidy/


Valid XHTML 1.0! Valid CSS! Bobby Approved Triple A