<!DOCTYPE html>

Search for a command to run...

No comments yet. Be the first to comment.
As i started learning Cascading, Specificity, Inheritance. Though at a higher level it was bit clear, but i felt difficulty in understanding what does initial, unset do. So i did some more learning, and learnt some more concepts in the process. So a...
most used
Machine Learning basics
As i started learning Cascading, Specificity, Inheritance. Though at a higher level it was bit clear, but i felt difficulty in understanding what does initial, unset do. So i did some more learning, and learnt some more concepts in the process. So a...
Website that you visit/read is a Document. As a human, when you write a Document on a Paper, or lets say print a Newspaper, you see Headlines and some part of the story below it, and links to remaining story on a different page. Some headlines will h...

After that small talk, in this post let's use some git commands. Additional Info:- For complete list of commands, refer this. Refer this Visual Git Cheat Sheet. Refer this for some detailed information. Refer this for commonly used commands. G...

On this page
When i started learning html few days ago, i used to forget mentioning <!DOCTYPE html>.
I thought learning more about it, i will start forgetting less.
So, What does it mean ? What happens if you don't or want to write ? Why should you write it at all ? and also in the beginning of the file and not in second line or after.
<!DOCTYPE html>
<! >markup declaration, that is carried forward from earlier versions of HTML. To let browser know that,<! This is HTML version x.x document !>or<!-- This is comment -- >
DOCTYPE- Documentation Type
html- version of HTML. Here it means HTML5.
Back old days, Web Browser was first developed in 1990 and NCSA Mosaic was the first browser to display images and text simultaneously and led to the Internet Boom.
Netscape Navigator developed by Netscape which employed many of the original Mosaic authors. Firefox is the successor to Netscape, as the Mozilla community was created by Netscape in 1998 before their acquisition by AOL.
Spyglass, Inc. licensed the technology and trademarks from NCSA for producing its own web browser, Microsoft licensed Spyglass Mosaic and later purchased.
Among few other players, Netscape and Microsoft had majority market share. Both Microsoft and Netscape liberally incorporated proprietary extensions to HTML in their products, and tried to gain an edge by product differentiation.
If you want more on this, this is the place.
Though W3C is in place many did not follow while developing their browsers. Here you can find what others opined back then.
Major upgrade of HTML Web Standards is v5.0 (W3C and WHATWG were working together)
W3C earlier documented all the standards/api's at WebPlatform and Later moved to MDN
As of today, Most of the browsers support these recommended standards, called Full Standards Mode i.e., the behavior described by the HTML and CSS specifications
So by writing <!DOCTYPE html> in the first line of your file, you are telling the Browsers to render the content based on the Full Standards Mode.
Here comes other 2 modes
this emulates browser behaviour as that of old legacy browsers.
this has few behaviours implemented from Quirks mode.
The only purpose of DOCTYPE is for the browser is to know on which mode rendering has to be. (and as to prevent entering Quirks mode as default).
Even if you write a comment on the first line and second line as DOCTYPE, your browser will enter quirks mode, and you will see unexpected behavior.
But what if you want to support your content on old Browsers i.e., before HTML 5.0, Nah. There is no reason that you want to spin your head on that. But if you want to really to support Legacy browsers or give a try, this is the link.
Apart from W3C, which is known best standard body, few other standards are