Choosing a DOCTYPE
While using Microsoft FrontPage, you might have never even
thought about using a DOCTYPE or even heard of this "declaration".
Now though, you might have seen this a time or two if you
have looked at the source code once you created a new web
page with Expression Web. Instead of seeing something
like
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
</body>
</html>
you might have seen
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
</head>
<body>
</body>
</html>
While it may appear that Expression Web is adding some unwanted code, an all too familiar problem with FrontPage, the declaration of a DOCTYPE is an essential component of compliant web pages.
Actually though, if you are one of those type of people
that
validates your code, then you probably will appreciate
this "extra" piece code.
You have a few DOCTYPEs to choose from as you can see from
the
Recommended List of DTDs.
So which one to choose? And why should I choose one
over the other? And is the latest DOCTYPE the best
one to use? Does Expression Web add the correct DOCTYPE?
Should I even both with a DOCTYPE if I am not going to validate
the code?
Those are very good questions. Some of these questions
have been "pondered" on numerous message boards in the past
by a lot of individuals giving very good reasons it seems
to use one over the other. For a great article, check
out
Fix your Site with the Right DOCTYPE. This will
answer some of the questions above. If you have more
questions on which DOCTYPE to use or why, please feel free
to ask the professionals at
International Web Developers Network.
For the most part,
HTML 4.01 DTD will satisfy a lot of the FrontPage /
Expression Web users. And Expression Web will put
in the proper DTD code for you when you have decided on
which one to use.
Choosing a DOCTYPE
To have Expression Web place the proper code in your web
page, Tools - Page Editor Options. In the Authoring tab,
you will see a section labels Doctype and Secondary Schema.
Under Document Type Declaration, choose HTML 4.01 Transitional
and hit OK. (
Video
tutorial on Choosing the DOCTYPE in Expression Web)
Now in all new web pages created with Expression Web, you
will see
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
at the top of your source code.
As the terminology implies, "loose" (or transitional) will be a bit easier
to validate than "strict". The validator will give
you a little bit of latitude. Whatever you choose,
Expression Web will try to produce source code that complies
with the standards. You will, of course, find problems
from time to time but you will see more problems if you
do not choose a DOCTYPE, especially in some versions of
Microsoft Internet Explorer.
As the article from A List Apart (
Fix Your Site With the Right DOCTYPE!)
mentions, some Internet browsers will display your web
page in
quirks mode
if a DOCTYPE is not used.
Amazon also has a few
HTML Books
that you might find very informative as well. Some
people like to be able to read books and most
HTML Books
will give you the basics you need to know to help you
huild and maintain your Expression Web site.




Comments