While making an HTML5 document, the principal line of the report ought to be this tag:
The DOCTYPE tag always begins with an exclamation point and is always placed at the beginning of the document, before any other tag. Most HTML tags are not case-sensitive, but the word DOCTYPE should always be uppercase.
Using the DOCTYPE tag is like signing a contract. It is an optional tag, but when you use it, you are promising that your coding will conform to certain standards. When a Web program experiences a DOCTYPE tag, it forms the page in guidelines mode. When it doesn’t encounter the DOCTYPE tag, it assumes that there is something quirky about the page, and processes the page in quirks mode. When the browser sees the tag <!DOCTYPE html>, it assumes you are using HTML5.
The qualification between norms mode and eccentricities mode came to fruition in before days, when there were problems with standardization between Web browsers. In some browsers, to show pages appropriately, you expected to get somewhat innovative with the HTML code.
Current HTML coding doesn’t permit that, yet some more seasoned pages despite everything incorporate these obsolete workarounds. By using the DOCTYPE tag, you are making a promise to the Web browser that there is nothing but pure HTML code on the page. Earlier versions of HTML used more complex DOCTYPE tags. If you’re using HTML Version 4.01, the syntax for the tag is:
<!DOCTYPE HTML PUBLIC “-//W3C/DTD HTML 4.01 Transitional//EN”
If you’re using XHTML, the syntax for the tag is:
<!DOCTYPE HTML PUBLIC “-//W3C/DTD XHTML 1.0 Transitional//EN”
Note: If you’re writing XHTML code, the DOCTYPE tag is required.