Click to See Complete Forum and Search --> : super newbie wants to start out right


Miss Ion Hills
02-10-2003, 03:38 PM
hello all

I find that you are all leaps and bounds ahead of me, but one must start somewhere.

This morning I thought that I saw a thread that contained the proper way to begin each page, but I am now unable to find it (and yes, I tried searching, so please forgive me).

I thought that maybe Charles noted the correct method, so I copied another example of one of his suggestions. Perhaps someone can tell me if this is the proper way to begin a page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">

Also please let me know if it is ok to keep the javascript part in there even if there is no javascript on the page. I would like to be able to use the entire things as a template, but I will modify it as needed.

I'm sorry that i was wordy, but I didn't want to not provide enough information to get the right answer.

Thank you in advance

Charles
02-10-2003, 04:08 PM
The HTML kernal, the minimum required, is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Some Title</title>

For a frameset it is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Some Title</title>
<frameset><noframes></noframes></frameset>

And if you use any inline scripts then you will need to have included something like:

<meta name="Content-Script-Type" content="text/javascript">

And if you use any inline styles then you sill need to have included something like:

<meta name="Content-Style-Type" content="text/css">

Note, the HTML, HEAD and BODY start and end tags are optional, but the HTML, HEAD and BODY elements are always there nonetheless. And you cannot put META elements in the document BODY and you cannot put P elements in the document HEAD. And HTML has a bunch of other optional tags, which can lead to confusion. It's a good idea, therefore, to always use the optional tags.

However, all this optional tag stuff makes HTML troublesome for computers, so the W3C has given us XHTML. If you are just starting out then you should be following the XHTML rules. Your basic XHTML document would look like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="Content-Script-Type" content="text/javascript" />
<meta name="Content-Style-Type" content="text/css" />
<title>Some Title</title>
</head>
<body>
</body>
</html>

Notice that in XHTML that the empty, stand alone tags have a trailing forward slash. And know that in XHTML all attribute values must be enclosed in quotes and that all element and attribute names are lower case. To keep yourself on track, always run your work through the validator at http://validator.w3.org/.

Miss Ion Hills
02-10-2003, 09:28 PM
Charles, I just returned home, turned-on the computer, and I am absolutly amazed at the wonderful amount of information you have provided me.

This is far more than I ever expected and I must thank you for taking so much of your time to do such an excellent job of explaining everything (and I do mean everything) so well.

I will heed your advice and explore XHTML as my new method. Just one question however,
Is the file ending name XHTML instead of HTML (index.xhtml)?

I should probably just go buy a book.
But thank you again Charles. This was great!
Missy

Zach Elfers
02-10-2003, 09:31 PM
XHTML file names are the same as regular HTML. Their extensions are just .html.

Miss Ion Hills
02-10-2003, 09:35 PM
Thank you for responding so quickly Zach. I wish I could get my pizza delivered that fast. Missy