Solved

Doctype?

Posted on 1998-06-10
5
270 Views
Last Modified: 2010-05-18
How shall I write "Doctype..."? I don´t understand which HTML standard I shall write
and if I shall write the lowest standard or the highest standard or all standards I use?

I have been on the World Wide Web Consortium:s site but I didn´t get any wiser...
0
Comment
Question by:ewakajsa
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:TAMC
ID: 1844171
What do you mean by Doctype?, I write lots of HTML files and never used such a thing.
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 10 total points
ID: 1844172
I agree with TAMC, I only used doctype for validators but since I am using HOMESITE with validation built-in, I have stopped using it. The strange thing is that a lot of people include one and the immediately ignores it.

If you insist, here is what IRT says:

A DOCTYPE statement (or DTD), located on the first line of an HTML document, designates the standard of HTML which
you have chosen to use. HTML Validators require DTD statements. Without a DTD, they will usually fall back to a default
DTD (many times HTML 2.0), most times causing many errors.

Three common DTDs are:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> for HTML 4.0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> for HTML 3.2
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> for HTML 2.0

There are many more DTD statements available for use...

Try http://www.ccs.org/html/dtd/
and http://www.ccs.org/html/dtd/why/index.html
for more info

0
 

Author Comment

by:ewakajsa
ID: 1844173
But I still don´t  understand if I shall write HTML 4.0 or 3.2....in Doctype. If I write HTML 4.0 in Doctype does that imply that the validator accept HTML below 4.0?
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1844174
Aha... The HTML you produce must conform to the DOCTYPE you write if you wish the validator not to puke. If you write any 4.0 html do not put 3.2 unless you are prepared for the error messages.

The validators are downwards compatible so if you write 3.2 HTML you may have a doctype 4.0 but will get error messages or warnings if you use any tags that was depricated (I know only of a few 3.0 tags that never made it into 3.2).

Enjoy,

Michel
0
 

Author Comment

by:ewakajsa
ID: 1844175
Now I get it....thanks a lot!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can't get the PDF Icon to appear on the webpage 1 21
Bootstrap 3 with accordion menu 2 46
How to avoid jquery conflicts in Wordpress ? 4 24
Enter key on html form page 11 48
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now