Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Is the new doctype really necessary for HTML5?

user-image
Question added by Jayahari KV , Web Designer / Manager , C-DIT
Date Posted: 2015/03/28
Murad Bin Makhashin
by 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