Samizdata - 8:46 pm on Jun 3, 2011 (gmt 0)
When I try to add a DOCTYPE declaration to my code, it causes problems
No, it is when you omit the DOCTYPE that the problems are caused.
Without the DOCTYPE browsers will render your markup in "quirks mode".
A common procedure is to use an HTML 4.01 DOCTYPE and test your pages in a compliant browser (Firefox, Opera, Safari) then tweak if necessary for Internet Explorer.
Until you have done that your problems are likely to persist.
Hope this helps.