Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Doctype?

Posted on 1998-06-10
5
Medium Priority
?
299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
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…

719 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