By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,624 Members | 2,229 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,624 IT Pros & Developers. It's quick & easy.

which document type

P: n/a
After changing some "old" web pages into CSS I noticed big differences
between mozilla and IE rendering. I finally noticed that the document type
was HTML 3.2.
I copied a more recent tag from another page which had 4.01 transitional.
The Mozilla and IE were then the same , although percentages seem to be less
than the figure given.
I see on web pages about CSS2 " document type HTML 4.0 transitional" or
sometimes HTML 4.01.
What shopuld the document type be. And what differences come about from
changing it.?
cpmac
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Colin McGarry" <WE**********@cpmac.com> wrote:
What shopuld the document type be.
If you are authoring new documents according to HTML and CSS
specifications, use HTML 4.01 Strict doctype (irrespectively what the
actual document type is - nobody cares, except validators, and you can
use "doctype override" if needed).

You might wish to occasionally check the effect of removing the doctype,
since this (roughly) shows how IE 5.x (which is still used by many)
displays the page. If it looks ugly, don't care. If it is unreadable, you
might consider doing something about it, probably simplifying your CSS
usage.
And what differences come about from changing it.?


They won't tell us. It has even been proclaimed that the effects of
doctype sniffing must remain undocumented.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #2

P: n/a
Colin McGarry wrote:
What shopuld the document type be. And what differences come about from
changing it.?


Brief guide to important HTML versions.

3.2 - attempt to describe the state of browser support some years ago.
4.01 - attempt to get HTML in to reasonable shape. There are three varients:
4.01 Frameset - for <frameset> documents (which should be avoided under
most circumstances)
4.01 Transitional - The version with most of the old presentational markup
4.01 Strict - The version without most of the old the OPM
XHTML 1.0 - exactly the same as HTML 4.01 but expressed using XML instead of
SGML.

HTML 4.01 Strict probably the best choice for new documents at present.

List of DTDs: http://www.w3.org/QA/2002/04/valid-dtd-list.html

The Doctype shouldn't have any influence over the rendering of pages, but
some browsers use it to guess how smart the author is. "This page has THIS
Doctype therefore the author knows about standards" Vs "This page has THAT
or NO Doctype there therefore I will emulate old buggy browsers".

http://gutfeldt.ch/matthias/articles/doctypeswitch.html

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.