"tidy" is a simple program that checks your HTML file for errors (i.e.
bad HTML), and if it has no errors will tidy it up to look good (for
example, to fix the junk the IE makes when it saves a web page).
Download the "tidy" program from tidy.sourceforge.com (choose the
Windows version).
Unzip it into \temp. Notice it's just tidy.exe
Start DOS (Start..Run..command).
cd \temp
We'll need a HTML file to test. Use
gakusei.ad.umuc.edu/~dwills/intro.html
View the source, notice the tags are in lowercase.
Save As into \temp. Then use PFE to look at the file, notice IE
changed the tags to
uppercase.
Run tidy, back in DOS:
tidy intro.htm -f errors |more (the |more makes the output a page
at a time, you don't
need it if you're using XP's cmd).
It reports 4 warnings but 0 errors.
If there were errors, fix them in PFE.
Now run tidy again, but we'll tidy up the file:
tidy -m intro.htm (the intro.htm file is changed)
Go to PFE and reload the changed intro.htm. Notice that it's been
tidied.
There are web sites that run tidy for you:
infohound.net/tidy you can upload a html file and it will do the
checking and tidying
for you.
Let's validate a HTML file using validator.w3.org
Upload the intro.htm file for it to validate.
Notice it indicates as errors what tidy said were only warnings.
Fix the errors in PFE: add an alt attribute to the two img tags,
something like
alt="a image of a tree"
Then validate again.