What is !DOCTYPE?
Experience Level: Junior
Tags: HTML
Answer
- The
<!DOCTYPE>
is a declaration that defines at what version of HTML the page is written in. In helps the browser to understand how it should read the document. - If the
<!DOCTYPE>
is ommitted, the browser is trying to interpret the document, but it could be displaying it incorrectly. For that reason always add the<!DOCTYPE>
to you document. - The
<!DOCTYPE>
declaration must be the first thing in your HTML document. It has to be even before the<html>
tag. - The
<!DOCTYPE>
declaration is not a tag.
Other !DOCTYPEs
Related HTML job interview questions
What is <sup> tag?
HTML JuniorWhat is <sub> tag?
HTML JuniorWhich version of HML do you use?
HTML JuniorWhat is <figure> tag?
HTML JuniorHow does HTML/CSS work with DOM?
HTML Junior