Reading Time: ( Word Count: )

Specifying Document Type In HTML

Description: This post may contain affiliate links; this means that if you click on a link and buy something we recommend, we can get a commission. Read more about the affiliate disclosure here.

While making an HTML5 document, the principal line of the report ought to be this tag:
<!DOCTYPE html>

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.

About the Author

Shayan Ahmed

Shayan is a passionate Blogger who has written technology-intensive articles since 2018, is a WordPress enthusiast, Bachelor, and also read Computer Engineering. You can find many interesting articles and help here.



Most Recent

Join Us

Follow Us

Most Related

Submit a Comment

If you have any idea please give to us. Or leave a beautiful comment to our post.


Leave your suggestion


Join us for latest deals and updates

Share This