Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Doctype?

Posted on 1998-06-10
5
Medium Priority
?
303 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 40 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
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…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

927 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