Click to See Complete Forum and Search --> : doctype tag


Cassius
01-17-2005, 08:56 AM
i have worked on some html pages and css files and all seemed to be working fine as i wanted it. Eventually, i did not have the doctype tag on the html pages, so now i added the following doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

However, as soon as i added this tag, it seems that i lost the position of some items (note that i added this tag to my .php pages, not to the .css file).

Does someone know, why this may happen, and what can i do to resolve it ?

Thank You

NogDog
01-17-2005, 09:02 AM
First thing to do is to validate your markup and stylesheet:

http://validator.w3.org/

http://jigsaw.w3.org/css-validator/

Without a doctype, non-standards-compliant browsers such as IE will run in "quirks mode" which means that (1) they don't necessarily display everything correctly and (2) they sometimes make "assumptions" if your markup is invalid.

I find that if I use a "strict" doctype, my markup and CSS is valid, and it displays correctly in Firefox, then 99% of the time it's good in IE, too. Your mileage may vary. :)