Solved

The Right DOCTYPE

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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

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 …
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…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

627 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