Good HTML, Why, How, and other persnickity
little things
Is there a better way--HTML editors and
converters
Matters of StYLe
- Featuring
-
Why write good HTML?
How do we write good HTML?
How do we know if we succeeded?
- There is an aesthetic pleasure in doing so.
- We DON'T know what browser is looking at the document.
- With good HTML, the document ought to at least display.
- With good HTML, it might even look the way it ought.
- With good HTML, even text-only browsers will work!
- When someone copies your page, they will at least be
starting with a good document
[end of document]
Some basic rules:
-
- Avoid overlapping tags: e.g., DON'T
-
<em>this text has <strong>overlapping</em>
tags</strong>
instead, use:
<em>this text doesn't have</em>
<strong>overlapping tags</strong>
-
- Avoid character tags embedded within other character tags:
e.g., DON'T
-
<em>this text has <strong>embedded character
tags</strong></em>
instead, use:
<em>this text has no</em> <strong>embedded
character tags</strong>
Character tags are those which define fonts
-
- Embed only anchors and character tags within other tags (other
than lists and tables): e.g., DON'T
-
<em>there is a paragraph<p> tag embedded
here</em>
or, another example:
<strong>
<dl>
<dt>this is an indented
<dd>list
</dl></strong>
instead, use:
<em>there is a paragraph</em><p><em>tag
here</em>
or, for the other example:
<dl>
<dt><strong>this is an
indented</strong>
<dd><strong>list</strong>
</dl>
-
- Avoid white space between tags and included text: e.g., DON'T
-
<a href="mypage.html"> this links to my page
</a>
instead, use:
<a href="mypage.html">this links to my
page</a>
- Follow all hyperlinks in a document to be sure that they work
(is this obvious?)
[table of contents]
[top of good html]
[end of document]
- Use
-
-
HTML Validation Services:
- the Suite of Validation
Suites
- Advantages:
- Easy to use
On-line help guide to try and decypher errors
- Disadvantages:
- Requires that the page to be checked be on a HTTP server
- To use:
- Give one of the suites the URL of your page, see what happens!
or
-
HTML Checkers:
- htmlchek
- Advantages:
- Don't have to have page on a HTTP server
No reliance on network speed
- Disadvantages:
- Unix based--therefore, powerful & esoteric
May be easier with just the
"awk" script and Gavin's
checkhtml front-end
- To use:
- type
checkhtml myfile.html
[table of contents]
[top of good html]
[end of document]
- Featuring...
-
HTML editors
HTML converters
HTML editors
There are HTML editors for all platforms, including freeware, shareware,
and commercial products. Gavin hasn't used any of them, and so can't
vouch for how good they are, other than
html-helper-mode for
emacs (which isn't an HTML editor per se, but with which all documenation
for this workshop and on the server running on brillig was written).
Check out the editor list on
The Web Designer, or ask
your friends.
- Advantages of HTML editors:
- you don't have to learn or remember all of the HTML that goes into
the pages that you are building.
- Disadvantages of HTML editors:
- you are limited to the HTML coded into them, and lose both control
over what they do to your HTML after you've entered it and
direct control of the appearance of your page.
HTML converters
- There are a growing number of HTML converters, which change
- LaTeX
Microsoft
Word
WordPerfect
and many other
files to HTML. Thus, if you have a WordPerfect file you can convert it
to HTML simply by running it through a converter.
- Advantages of converters:
- They're easy!
You don't have to learn all of the nuts and bolts of HTML
You can convert existing documents (relatively) painlessly into HTML
- Disadvantages of converters:
- Word processors do far more than HTML can--therefore, you are at
the whim of the converter for what you get as HTML.
you are limited to the HTML coded into them, and lose both control
over what they do to your file and direct control of the appearance
of your page.
[table of contents]
[top of betterway]
[end of document]
- Some thoughts:
- Large Graphics may take ages to load
- Web Surfers rarely scroll
- (so put links and important stuff at the top of the page)
Eschew Verbosity
- Put information on the WWW that isn't already there
- (or that is unique to you)
- For further stylistic thoughts, see:
- CERN's
Style Guide
Jonathon
Cohen's Elements of HTML Style
Sun's Style Guide
Some Bad Style Examples
and
NCSA's
list of style guides
(this is not a complete list...)
[table of contents]
[workshop home]
[previous (reusing HTML)]
[next (advanced html)]
[templates]
last modified on 16 May 1996
Other Issues
http://brillig.NebrWesleyan.edu/~glarose/summary/workshop/otherissues.html
Comments to:
glarose@NebrWesleyan.edu