Webmaster Tips
DocTypes, Page Validation, and Browser Checks
As HTML standards continue to progress, new requirements are coming into play which older (and less thorough) HTML generators - and those of us who still hand-code much of our work for whatever reason - may not be aware of.
One important piece is the DocType tag.
This tag simply defines the type of document and the HTML standard that it supposedly complies with. The new browsers read this, and from it know better how to display the page properly. The DocType tag is placed at the beginning of the file, before the HTML tag. (if you're using scripting CGIs such as PHP or Websiphon which often put code before the HTML tag you may need to do a little research as to whether it must go before the CGI code or after. Generally it'll need to go after.)
Some common DocType tags include:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
The URL in those tags points to overviews of the allowed tags and their appropriate uses. We're currently (January 2003) doing much of our code under HTML 4.01 Transitional.
Validation
HTML is getting more and more complicated, the standards are getting stricter, new browser versions are following the standards, and you can no longer get away with some of the coding practices of the past. Unless you do a whole lot of code, it can be hard to remember every rule for a given set of standards.
That's where code validators come in.
You basically define the standard you wish to live up to, submit your page to a validation mechanism, and it checks the syntax of your code and spits out a list of errors.
There are several online validation tools that allow you to type in the URL and choose the standards, click a button and get the results. There are also validators built in to some coding tools, like BBEdit. Personally, I use the online validator at http://validator.w3.org/detailed.html a lot these days (choosing the appropriate standard and "view source"). You *must* include a DocType tag in order for this validator to do its work.
Remember that the validators are not perfect either.
Browser Compatability Checks
One of the things we do here is check our code in several of the major browser versions, on several different platforms. Your page can be displayed quite differently on one browser and platform combination than another. Each interprets and displays certain tags a little bit differently - and generally still within the HTML standards, these days.
Since it's likely that you don't have a bunch of machines available running multiple browser versions, platforms, etc - and who in their right mind would want to have a WebTV setup - there are emulators available online that will render your code as it would be displayed in various browsers.
An online browser compatability checker that we've been using lately is at http://www.anybrowser.com/siteviewer.html. Scroll down the page for a more "tweakable" version. A nice feature about this checker is that it allows you to follow the links and check those pages as well.
Home
|