zygoma — 2013-01-03T04:58:41-05:00 — #1
Buongiorno from 10 degrees C wetherby UK
I understand a HTML page has to start with a !DOCTYPE line but I wonder what are the consequences if your web page was not written in HTML 5 and you strated the first line with <!DOCTYPE html>.
markbrown4 — 2013-01-03T05:18:31-05:00 — #2
It will just change the rules used for validation services like http://validator.w3.org/
stevie_d — 2013-01-03T07:33:33-05:00 — #3
Because HTML5 used the principle of "pave the cow-pats", the idea was that pretty much anything that was valid in HTML4 would continue to be valid in HTML5, to maintain backwards compatibility. There are only a tiny number of things that are likely to become invalid with the move to HTML5, so it is unlikely to be a problem. Even if you do use invalid code (whether outdated or just plain wrong), with HTML (but not XHTML) browsers are generally as forgiving and accommodating of bad code as they can be, so they will do their best to show what they think you meant.
ralphm — 2013-01-03T07:46:44-05:00 — #4
Remember that "HTML5" is just HTML, so as long as your page is HTML, that doctype is fine. The doctype you have cited is intended for HTML (as it indicates itself), that's all. As said, the validator looks at what doctype you've cited to decide what set of rules to validate against, but that's kind of irrelevant to the actual web page and how it functions in a browser. I now use that doctype in all my pages—because it's nice and simple—but I don't use any of those silly elements like <nav> and <section>.
zygoma — 2013-01-03T08:53:09-05:00 — #5
felgall — 2013-01-13T13:30:29-05:00 — #6
HTML 5 is using the short version of the HTML 2 doctype so all that doctype tells anyone is that the HTML is not version 1.
system — 2014-10-07T23:31:53-04:00 — #7
This topic is now closed. New replies are no longer allowed.