Re: Off Topic: Need some HTML coding feedback


Subject: Re: Off Topic: Need some HTML coding feedback
From: Christopher E. Brown (cbrown@woods.net)
Date: Fri Jun 07 2002 - 08:23:49 AKDT


On Wed, 5 Jun 2002, James McMorris wrote:
> Are there any HTML gurus on the list that can give some feedback? I'm
> just learning and decided to run my code thru TidyHTML which is
> supposed to help you find errors and reduce size.
> http://tidy.sourceforge.net/

You need to visit www.w3.org and read up on HTML standards (and you
may find the validator their useful).

You are writing untyped HTML, so browsers and tools have no idea what
standards to apply.

An example would be

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="Author" content="Christopher E. Brown <cbrown@woods.net>">
<meta name="keywords" content="proper, html">
<meta name="ROBOTS" content="ALL">
<link rel="stylesheet" type="text/css" href="mystyle.css">
<title>The title</title>
</head>
<body>

<h1>This is a header</h1>

<p>I am enclosing this block of text it a paragraph tag pair</p>

<pre>And this one in preformat tags</pre>

</body>

I would suggest sticking with HTML 4.01, STRICT and FRAMESET DTDs.

Once you get past HTML 3.02 the tag definitions get more strict. For
example <p> tags need to be used in pairs (<p></p>), and the DTDs call
for *all* text to be enclosed in *something* (so it can be defined).

HTML 4.01 Transitional relaxes alot of the newer restrictions, but
HTML 4 has been around since 1997 or so, if you are bothering to do
proper HTML by hand you mught as well do it right and use 4.0
strict/frameset. (strict for all general pages, and frameset for
framing windows).

Setting the DTD, content type, charset and lang is important! Without
these setting the browser defaults to something, but you never know
what.

XHTML standards are out, but for general use I would stay away. Many
browsers (netscape 4.x included) don't know how to render XHTML yet,
and alot of users cannot view. However a browser that cannot handle
4.01 is just broken.

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Fri Jun 07 2002 - 08:29:01 AKDT