What is HTML?

HTML (HyperText Markup Language) is used to give content to a web page and instructs web browsers on how to structure that content.

HTML Structure

HTML is organized into a family tree structure. HTML elements can have parents, grandparents, siblings, children, grandchildren, etc.

HTML Elements

An HTML element is a piece of content in an HTML document. The content of an HTML element is the information between the opening and closing tags of an element.

HTML Attributes

Attributes are values added to the opening tag of an element to configure the element, change the elements default behavior or provide additional information about elements.


Elements List

Metadata
<head> contains machine-readable information (metadata) about the document, such as title, scripts, and style sheets
<link> specifies relationships between the current document and an external resource. It is used to link to style sheets, fonts, and site icons
Sectioning
<body> represents the content of an HTML document. There can be only one <body> element in a document
<address> indicates that the enclosed HTML provides contact information for a person or people, or for an organization
<article> represents a self-contained composition in a document, which is intended to be independently distributable or reusable. Examples include: a forum post or a user-submitted comment
<footer> footer for its nearest ancestor sectioning content or sectioning root element. It contains information about the author of the section, copyright data or links to related documents.
<header> represents introductory content, typically a group of introductory or navigational aids. It may contain logo, a search form, an author name, and other elements
<h1-h6> represent six levels of section headings
<main> represents the dominant content of the body of a document. The main content area consists of content that is directly related to or expands upon the central topic of a document
<nav> represents a section of a page whose purpose is to provide navigation links, either within the current document or to other documents
<section> represents a generic standalone section of a document, which doesn't have a more specific semantic element to represent it. Sections should always have a heading, with very few exceptions
<address> indicates that the enclosed HTML provides contact information for a person or people, or for an organization
Text Content
<div> represents the content of an HTML document. There can be only one <body> element in a document
<figcaption> indicates that the enclosed HTML provides contact information for a person or people, or for an organization
<figure> represents a self-contained composition in a document, which is intended to be independently distributable or reusable. Examples include: a forum post or a user-submitted comment
<hr> footer for its nearest ancestor sectioning content or sectioning root element. It typically contains information about the author of the section, copyright data or links to related documents
<li> footer for its nearest ancestor sectioning content or sectioning root element. It contains information about the author of the section, copyright data or links to related documents
<ol> represents introductory content, typically a group of introductory or navigational aids. It may contain logo, a search form, an author name, and other elements
<ul> represent six levels of section headings
<p> represents the dominant content of the body of a document. The main content area consists of content that is directly related to or expands upon the central topic of a document
Inline Text Semantics
<a> with its href attribute, it creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address
<br> produces a line break in text
<cite> used to mark up the title of a cited creative work
<code> displays its contents styled in a fashion intended to indicate that the text is a short fragment of computer code
<em> marks text that has stress emphasis
<mark> represents text which is marked or highlighted for reference or notation purposes
<span> generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes
<strong> indicates that its contents have strong importance, seriousness, or urgency
Image and Multimedia
<audio> used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute
<img> embeds an image into the document
<video> embeds a media player which supports video playback into the document
Table Content
<caption> specifies the caption (or title) of a table
<col> defines a column within a table and is used for defining common semantics on all common cells. It is generally found within a colgroup element
<colgroup> defines a group of columns within a table
<table> displays information presented in a two-dimensional table comprised of rows and columns of cells containing data
<tbody> encapsulates a set of table rows (tr elements), indicating that they comprise the body of the table
<td> defines a cell of a table that contains data
<tfoot> defines a set of rows summarizing the columns of the table
<th> a cell as header of a group of table cells. The exact nature of this group is defined by the scope and headers attributes
<thead> defines a set of rows defining the head of the columns of the table
<tr> defines a row of cells in a table. The row's cells can then be established using a mix of td (data cell) and th (header cell) elements