What does this tag do?
What I can see is that with this tag on top my html behaves in another way than without. How do I k
To understand the significance of DOCTYPE let us dig into some history starting from the days of browser wars. During those days web pages were written in two different versions to support both Internet Explorer & Netscape Navigator.
But then W3C took over defining Web Standards. But sadly, browsers with new standards were not able to render web pages built for legacy browsers. So, to support the website built for legacy browsers QUIRK MODE was introduced. In which the browser assumes you’ve written old-fashioned, invalid markup and code per the depressing industry norms of the late 1990s.
To differentiate those website from the new ones, DOCTYPE was added, which gave the browser a signal that this web page should be rendered in STANDARD MODE.
Prior to HTML5, the html was SGML based which required a Document Type Defination to establish rules and grammer for markup. Thus, doctype had other information about the Document Type Defination (DTD).
However, with introduction of HTML5 the DOCTYPE is the only thing needed to enable the STANDARD MODE.