Do I need proper DOCTYPE in my head HTML?

  • Thread starter Tommy Desperate
  • Start date
T

Tommy Desperate

I posted a question to a specific problem once before and got an answer from
R. Symonds that solved my problem. This question is more general. Do I need
to place the DOCTYPE code in the head of each web page?

An article by J. Zeldman, "Fix Your Site with the Right DOCTYPE," says,
"DOCTYPES are also essential to the proper rendering and functioning of web
documents in compliant browsers like Mozilla, IE5/Mac, and IE6/Win."


I have two questions: (1) How do I find the doctype of my website -
www.hairloss-reversible.com? and (2) Is the insertion of this code really
important, for example, if I want to validate my HTML code?

One more point. In the Code Snippets dialogue box of my FrontPage 2003
program there are two default snippets - dt2 and dt3. The dt2 snippet is -
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> Could this be the proper
code for my site? The dt3 snippet is similar.
 
M

Murray

(1) How do I find the doctype of my website -

You look at the first two lines of code -


<html>

<head>In this case, there is no doctype. Is that what you meant? Or did
you mean how do you decide which to use? You just pick one. Until you
understand standard HTML coding, I suggest you use Loose (or transitional),
i.e.,

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
(2) Is the insertion of this code really
important, for example, if I want to validate my HTML code?

Well, sure - it won't be valid HTML 4.01 until it has a valid and complete
doctype.
One more point. In the Code Snippets dialogue box of my FrontPage 2003
program there are two default snippets - dt2 and dt3. The dt2 snippet is -
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> Could this be the
proper
code for my site?

It's close but incomplete (it's also out of date, but that's another
thread). Using this doctype would be no different than not using one at
all. To be complete, the doctype must also contain the URL as shown in my
first answer, above. I have already edited my snippets to reflect this....
 
C

clintonG

Short answer is yes, Zeldman is a respected professional and you should
include a DOCTYPE in every document.
Using DOCTYPE is critical to validation, CSS, XML and any function that
complies with W3C standards not to mention many proprietary vendor
implementations.

Briefly, a DOCTYPE defines which tags a document can support, how many, what
'type' and so on.

Note it has been discovered that preceeding a DOCTYPE with HTML comments
will hinder and break the use of the DOCTYPE so the DOCTYPE declaration must
be the very first statement in each file.

Keep studying you're on the right track.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top