Solved

The Right DOCTYPE

Posted on 2004-10-03
4
563 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ebay style="image-orientation: 90deg;" 2 38
Input box width 6 26
Converting dates in JavaScript 2 35
CSS: How do I override in-line styling 11 15
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

777 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