Im writing html and css in an old web application that is using the following doctype
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
If i change it to html5 doctype, the menu wont work. My problem is that i cant use some css selectors, like
input[type="radio"]
for instance. But this obviously works with the html5 doctype. Any possible solutions for this? Thanks!
The doctype you mentioned (HTML 4.0 Transitional without URL) triggers quirks mode. This causes that Internet Explorer’s rendering is similar to IE5. Your website works fine in quirks mode probably because it’s optimized for such old versions of IE: for example, it may assume the border-box box model. Naturally, you cannot use more complicated CSS selectors because IE5 didn’t support them. The solution is to rewrite the code for standards mode rendering. The usual approach is to develop the application with HTML5 doctype in standards-compliant browsers like Firefox, Chrome or IE9 and then try to fix bugs that can appear in older versions of Internet Explorer.