A Complete Guide to Web Design

(やまだぃちぅ) #1
Writing Good HTML 11

BrowsersA Variety of

Writing Good HTML

Web Design in a Nutshell, eMatter Edition

Some sites allow their users to decide which version they’d like to see. It’s not
uncommon to arrive at a site and be asked to choose between a souped-up
version or a text-only version, or to choose between frames or no-frames. This
puts the control in the hands of the viewer.


A more sophisticated approach is to automatically serve up an appropriate version
of the page for the browser that is making the request. JavaScript is capable of
basing actions on the browser being used (see Chapter 22,Introduction to Java-
Script). Pages can also be assembled on the fly for a particular browser using
Server Side Includes (see Chapter 13, Server Side Includes). Hotwired’s
WebMonkey site is a great example of this method in action,plusthey share their
secrets, so check it out athttp://www.webmonkey.com/.


Of course, this approach takes a bit more time and technical know-how, but it has
its rewards.


Writing Good HTML


Whatever your chosen browser, one key to success is to make sure you are
writing HTML correctly.


HTML Validation Services


There are a number of online resources that check your web site for various
quality issues, including the browser compatibility (or HTML Specification compli-
ance) of your HTML code. There are also HTML validators that check your code
for errors.


All will do a certain number of tests for free; however, to get the really good stuff,
you generally have to pay for the individual service or a year’s subscription for full
access to the site. For example, WebSiteGarage provides a nifty (and fee-based)
feature called “Browser Snapshot” that will provide up to 18 screenshots of your
page on a variety of browsers, including all past versions. This can be a good way
to run tests if you don’t have access to all of these browsers on your own.


Some of the more popular HTML validation services include:


The World Wide Web Consortium’s HTML Validator
http://validator.w3.org/


WebSiteGarage
http://www.websitegarage.com/


NetMechanic
http://www.netmechanic.com/


Doctor HTML
http://www2.imagiware.com/RxHTML/


If these don’t suit you, there are a large number of HTML validators listed on
Yahoo.


List of Validators on Yahoo
http://www.yahoo.com/Computers_and_Internet/Information_and_Documen-
tation/Data_Formats/HTML/Validation_and_Checkers/

Free download pdf