I had to repurpose some old code for a rush job, and while that code QA’s fine it turns out not to have a doctype declared. When I add a doctype, it breaks the design in IE. Ideally, I would be able to declare whatever doctype is assumed when none exists, but don’t know if that’s possible. Is there a way I can declare a doctype without changing the behavior created by a page w/o any doctype declared?
Share
Without a doctype, IE will show the page in quirks mode. To keep IE in quirks mode with a doctype, you can add a comment (
<!-- -->) before the doctype.Edit: if it’s just IE6 causing problems, the XML prolog (
<?xml version="1.0" encoding="utf-8"?>) will keep it in quirks mode.Edit 2: there’s actually lots of doctypes that will keep IE in quirks mode. You should be able to find one you can validate against.