"HTML tags" are definitions enclosed in HTML documents inside a pair of angle brackets ( < > ), and are used to describe the flow of the structure of the document, "marking up" elements inside and around them with special meanings.

Filed under

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:

<html>
</html>

Fundamental tags

!DOCTYPE

<!DOCTYPE html>

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">

html

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:

<html>
</html>

head

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:

<head>
</head>

title

The "title" tag provides title for the HTML document. This is displayed in the title bar of the browser window or tab.

<title>
</title>

body

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.

<body>
</body>

Related content

Structuring HTML, CSS and Javascript content

HTML5 Note App Tutorial


Twitter Facebook LinkedIn Youtube Slideshare Github