Solved

Doctype?

Posted on 1998-06-10
5
266 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Column Spacing 3 38
PDF to HTML conversion that looks good on Android Phones 3 54
HTML5 and Javascript 3 36
Menu Inconsistent 3 22
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

746 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

13 Experts available now in Live!

Get 1:1 Help Now