PDA

View Full Version : Doctypes


ragol_67
04-11-2004, 10:28 PM
I am a little confused about DOCTYPES. If I am using more than one type of code, which I do on every page. (IE... HTML, PHP, CSS) Do I have to put a DOCTYPE for each of those codes? If not, what DOCTYPE do I put down?

gsnedders
04-11-2004, 10:34 PM
A doctype is about the HTML + CSS only, so it doesn't matter how many types of code you have, the options are
HTML Strict
HTML Loose
HTML Frameset
XHTML Strict
XHTML Loose
XHTML Frameset

missing-score
04-11-2004, 10:42 PM
And also add HTML & XHTML Transitional.

The doctype specifies the way the browser should interpret the code. If you are using XHTML 1.0 Strict for a CSS based design, it will look different (or is likley to look different) if you then change the doctype to HTML Loose.

For general web pages you should be using XHTML and CSS, so a doctype of XHTML Transitional or XHTML Strict would be used. If you are using any PHP code, you dont need to set a doctype, just make sure script output is valid for the doctype you are using.

(You can validate your pages at http://validator.w3.org)

Alex Vincent
04-12-2004, 04:06 AM
And also add HTML & XHTML Transitional.

As I understand it, the "loose" DTD's are formally called Transitional.

gsnedders
04-12-2004, 11:51 AM
As I understand it, the "loose" DTD's are formally called Transitional.

That's how I understand it, I just can naver remember how to spell Transitional ;)

lnxusr86
04-12-2004, 03:30 PM
There is only one DTD in XHTML 1.1 unlike XHTML 1.0 which included Strict, Transitional and Frameset

XHTML 1.1 DTD:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

You may wish to have a look at the following website of the List of valid DTDs you can use in your document

URL: http://www.w3.org/QA/2002/04/valid-dtd-list.html

missing-score
04-12-2004, 04:23 PM
The only thing to remember is that as XHTML 1.1 has to be served as application/xhtml+xml, Internet Explorer, which makes up most of the web community, will try to download the file.