View Full Version : Resolved I have a question about DOCTYPEs, please.

06-11-2012, 03:19 AM
The site I've been working on is mostly all PHP files and has this DOCTYPE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" dir="ltr" >I needed a registration/login feature and found one that works well. I incorporated it into my site but I notice that its native files have this DOCTYPE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">That's how the author intended it, apparently and so my question becomes: can these two DOCTYPEs co-exist or must one be conformed to the other? The files for the registration/login feature are in their own directory but my site's files do call for them in forms, etc.

Am I about to break something? :o

06-11-2012, 03:31 AM
The transitional doctype is for web pages originally written using HTML 3.2 that are still in the process of being rewritten to use HTML 4.

The strict doctype is for pages where all the HTML 3.2 has been removed (or was never there) and so the page is written entirely in HTML 4.

You can use both on different pages depending on whether your page is still using code that has been obsolete since 1997 or not.

06-11-2012, 03:35 AM
Ah..... this wasn't on my radar when I started this thread, but suspicions now arise as to why IE has been stinking up the joint... :)

Thanks so much. I'll do a little validating and clean-up, then. (Yay for test sites.)