Solved

The Right DOCTYPE

Posted on 2004-10-03
4
561 Views
Last Modified: 2013-11-19
Hi,

 Sometime back I had raised a query with respect to my code. It was a simple DHTML menu, I alwaays got few negetive response coz few of them were not able to see the output of my code. The reason was it doesnt work on on Stricter doc type.

I had a similar situation at office. We migration exercise where a site's underlying technology was shifted from one to another, from epicentric to weblogic portal. When the constructed pages from weblogic were viewed, it was totally out of sync. All alignment were gone for a toss. After a long investigation, it was found earlier the doctype was "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">" and now it is on STRICT.DTD.

I would like to know
1. which is the right DOCTYPE to be used.
2. Can I get a listing of all HTML tags compatible to all DOCTYPE
3. Are there any basic Do's and Dont's where in this kind of compatibility problems can be avoided.

If not by explanation if any one can guide me with URLs from where I can get these information it would be nice

Thanks a lot
Gops
0
Comment
Question by:gops1
4 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 20 total points
ID: 12212743
Hi gops1,

http://www.alistapart.com/articles/doctype/

Use your judgement. If you use frames, use one of the Frameset doctypes. If you use <font> tags or other tags like that to format HTML (possibly even <b>, not sure), choose Transitional. When in doubt, choose transitional. If you want it oh-so-perfect, go with Strict and use a validator.

Do xhtml if you feel your page is xhtml compatible, i.e. all tags/attributes are in lowercase. All attributes have quotes around them, and all tags have closing tags, even the single tags.

Regards,
Zyloch
0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 20 total points
ID: 12212753
Here is a list of W3C defined DTDs:
http://www.w3.org/QA/2002/04/valid-dtd-list.html

I don't think you are going to find a comprehensive list of what is support or not supported cross-referenced by Doctypes.  It is not so much what is or is not support, but rather how things get interpreted, an how the DOM get built

For working throught the quirks, this is as good a site as there is:

http://www.quirksmode.org/index.html?/viewport/compatibility.html

Cd&
0
 
LVL 10

Expert Comment

by:Havin_it
ID: 12215763
Validation is my favourite way of weeding out tags and constructions that aren't supported in the W3C specs. you can use a bookmarklet like this (create a bookmark for any page and replace the URL with this string):

javascript:location.href='http://validator.w3.org/check?uri='+escape(self.location.href);

If you don't want to rewrite the DOCTYPE for your page when you validate, you can use the validator's override by adding a parameter to the URL, like this for XHTML 1.1:

javascript:location.href='http://validator.w3.org/check?uri='+escape(self.location.href)+'&doctype=XHTML+1.1';

Or you can get Mozilla Firefox and add the Web Developer extension which gives you this option (and more) from a toolbar.

Hope that helps
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

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.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will learn how to dynamically set the form action using jQuery.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

19 Experts available now in Live!

Get 1:1 Help Now