- Document type declaration otherwise known as Doctype is an instruction used by web browsers to fetch what version of HTML the website is written in.
- For understanding, it helps browsers how the document should be interpreted thus eases the rendering process. It is neither a tag nor an element.
- The top of the document was the Doctype should be placed.
- It does not need a closing tag and does not contain any content.
Syntax:
<!DOCTYPE html>
For example,
[pastacode lang=”markup” manual=”%3C!DOCTYPE%20html%3E%0A%3Chtml%3E%0A%3Cbody%3E%0A%20%20%20%20%20%3Ch1%3EWelcome%20to%20Kaashiv%20Infotech%3C%2Fh1%3E%0A%20%20%20%20%20%3Ch2%3EThis%20is%20HTML5%20Doctype%20Tag%3C%2Fh2%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E” message=”” highlight=”” provider=”manual”/]Output

