HTML Basic Elements Cheet Sheet

What are Elements?

An element is a part of a webpage. An element may contain a data item or a chunk of text or an image, or perhaps nothing. A typical element includes an opening tag with some attributes, enclosed text content, and a closing tag.

The content of an HTML element is the information between the opening and closing tags of an element.

Document Structure

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

Opening tag Closing tag Description
<html> </html> The root element of an HTML document; all other elements are contained in this..
<head> </head> Container for processing information and metadata for an HTML document.
<title> </title> Defines the title of an HTML document. It is displayed in the browser’s title bar or tab.
<body> </body> Container for the displayable content of an HTML document.

Section Heading

The <h1> to <h6> HTML elements represent six levels of section headings. <h1> is the highest section level and <h6> is the lowest.

Opening tag Closing tag Description
<h1> </h1> Highest-level heading
<h2> </h2> Next level down to <h1> (sub-section)
<h3> </h3> Next level down to <h2> (sub-sub-section)
<h4> </h4> Next level down...
<h5> </h5> Next level down...
<h6> </h6> Lowest-level heading

Basic Text and Lists

Very common elements found in almost every HTML document.

Opening tag Closing tag Description
<p> </p> Creates a paragraph, which contains and displays a block of text.
<ol> </ol> An ordered (enumerated) list.
<ul> </ul> An unordered (bulleted) list.
<li> </li> A list item in ordered (ol) or unordered (ul) lists.

Other Common Elements

Opening tag Closing tag Description
<a> </a> Anchor: is used to create hyperlinks in an HTML document.
<span> </span> Generic inline container to separate pieces of text from a larger body of text (mainly for styling purposes).
<img> Self closing It embeds images in documents.
<br> Self closing It creates a line break in text and is especially useful where a division of text is required.