Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

Is the new doctype really necessary for HTML5?

user-image
Question ajoutée par Jayahari KV , Web Designer / Manager , C-DIT
Date de publication: 2015/03/28
Murad Bin Makhashin
par Murad Bin Makhashin , Software Developer , Dar Al Tamleek

By not providing a doctype you will trigger the browser to render your HTML in something called "Quirck Mode" (at least this is the case with IE). The way it works is if you put any valid DOCTYPE declaration at all in your page the assumption is that you know what you're doing and your browser will render in a standards compliant way, and if you don't put one in it will render in the old "wrong" way. So in a webpage your doctype should match the version of HTML you are using. In other words, yes you need <!doctype html> at the very beginning of your HTML document if you are planning to use HTML5.

 

I hope this answers your question.

 

Happy coding :)

More Questions Like This