I designed a webpage and tested it on firefox, chrome & IE-8. The webpage is displayed fine on firefox & chrome but not on IE.
In the process of making it compatible, I changed the DocType declaration from HTML 4.01 Transitional to XHTML 1.1 to HTML 4.01 Strict. This failed to fix the cross compatability. Also, I found that the webpage design is messed up on firefox & chrome when I change the DocType from HTML 4.01 Transitional to XHTML 1.1.
Now my question is, if DocType does matter in designing webpages, which one should I use for cross compatibilty? Is there another solution that does not involve DocType?
It sounds like you’re only changing the DOCTYPE, but not changing any HTML or CSS. This is something you’ll need to do since each DOCTYPE will be rendered differently.
I recommend one of the STRICT ones – HTML4.01 STRICT, XHTML1.0 STRICT, or XHTML1.1, depending on your needs. Or HTML5 (although I haven’t used it yet myself). Also, make sure you’ve got the doctype declaration correct and have included the xmlns in the html tag if you’re using XHTML.
For reference:
compatibility info.
articles.
often.
And to check your doctypes:
HTML 4.01 Strict, Transitional, Frameset
XHTML 1.0 Strict, Transitional, Frameset
XHTML 1.1
HTML5