Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

The Right DOCTYPE

Posted on 2004-10-03
4
Medium Priority
?
573 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 80 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 80 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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 …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

971 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