HTML tags normally come in pairs, having a "start tag" and an "end tag", where both tags have the same "name", but the ending tag starts with a slash (/), like this:
The DOCTYPE tag is not part of the HTML document content itself. It is rather an instruction to the browser about the HTML version that was used on the page. In the case of the above sample, the browser knows that the document is HTML version 5 ("HTML5"). The document type definitions for HTML4 is much longer:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
The entire content of an HTML document is supposed to always go inside an "html" tag. This means that right after the !DOCTYPE definition, an html tag should be opened (with "<html>"), and it should only close (with "</html>") at the end of the file:
An HTML document is supposed to start with a "header" section, defined inside opening and closing "head" tags, which does not contain visible content, but rather defines the characteristics and additional information about the document / page. It can commonly include a title for the document, scripts, styles, metadata information and more. The header is defined with the "head" tags as follows:
The "title" tag provides title for the HTML document. This is displayed in the title bar of the browser window or tab.
The "body" tag contains the visible page content. You must use this tag only once, and it should start immediately after the closing tag of the head and should end directly before the closing tag of the html tag.