HTML <! DOCTYPE>
This is not a tag in HTML. This is called document type declaration. As you can guess by its name, it provides information about the type of document. This information helps the interpreter to organize the webpage in a better way.
<!DOCTYPE> declaration provides information to interpreter about the HTML version which is used in an HTML document. Many browsers do not support old HTML versions so whenever you create an HTML document, <!DOCTYPE> declaration tells the interpreter what version of HTML you are using.
Whenever an HTML document is rendered in the form of a webpage, it is first checked by the validators whether the HTML document is valid or not. The different validator is used to validate every version of HTML.
<!DOCTYPE> declaration tells the validator that the HTML document is to match with which HTML version. If the validators can't validate the document, then you can't show the webpage.
Whenever you declare <!DOCTYPE> in an HTML document, it must be the first line of the HTML document.
Syntax of HTML <! DOCTYPE>
<!DOCTYPE> is declared differently in every version of HTML. These are being described below.
HTML 4.01 <! DOCTYPE> Declaration
In HTML version 4.01, <!DOCTYPE> is defined in three modes (Transitional, Frameset, and Strict). All elements of HTML are allowed in the Transitional mode, but frame-set is not allowed in this mode.
Frameset mode is also like transitional mode, but framesets are allowed in it.
In the Strict mode, all other elements except HTML are presentational elements and framesets are allowed.
XHTML 1.0 <! DOCTYPE> Declaration
Similar to HTML4, it is declared in XHTML <!DOCTYPE> three modes. These modes apply in XHTML only to those that are in HTML4 but their syntax is different. The syntax of all these modes is being given below.
Transitional
Frameset
Strict
<!DOCTYPE> in HTML5
In the HTML5, <!DOCTYPE> declaration has been made very easy and simple.
<! DOCTYPE html>
Hopefully, this "HTML Tutorial - <!DOCTYPE>” would be helpful for you. If it's so please help your friends and other bloggers to share this post on social media. If you have any question related to the post, please comment on the comment box and also follow this website for more information about the blogging and SEO tips.
0 Comments:
Post a Comment
Thank you for reading this post. Please do not enter any spam link in the comment box.