Solved

The Right DOCTYPE

Posted on 2004-10-03
4
560 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
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 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 …

771 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

11 Experts available now in Live!

Get 1:1 Help Now