简体   繁体   中英

Is HTML 5 a superset of HTML 4.01 Transitional?

We have a PHP framework which was originally written in 2005, and consequently the default DOCTYPE is HTML 4.01 Transitional .

Whilst this can be overridden, most projects (even recent ones) have not changed the default, and so most projects will be serving documents as HTML 4.

All HTML generated by the framework has been designed to pass the W3C HTML 4 Validator, and most projects will also be generating valid HTML as this is a company requirement (though exceptions are allowed where necessary, eg use of some new HTML elements like <canvas> which would fail the HTML 4 validation but which browsers all nevertheless handle correctly).

My question: If I simply switch the framework to use a modern DOCTYPE will the HTML 4 mark-up validate correctly as HTML 5, or will I also need to make changes to the code?

A secondary question: Will rendering or browser support be affected by this change?

If I am reading this wikipedia article correctly then all browsers will be going from Quirks mode to Standards mode. This means that browser rendering is likely to be affected.

I don't know about the validation, but since rendering will be affected it is a safe bet to assume the validation will as well.

Interesting reading:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM