HTML Text Elements

Download (.odt) Download (Markdown)

Headings

[hook]

There are 6 levels of headings in HTML (h1-h6):

These appear with different font sizes by default (h1 is the biggest, h6 is the smallest) but you can apply custom CSS styles to change them.

Go to the CSS Text Styles cheatsheet

Pro Tip: you should use only one h1 heading per page because search engines find out what's the page about from the content of h1 element.

Paragraph

[hook]

p element:

Styled text elements

[hook]

These are often used inside p elements to add styles to the text.

Bold

b or strong element:

The text “dolor sit amet” will be rendered as bold.

(Strong element is also useful for SEO purpose because it shows the search engines that piece of text is important.)

Emphasized

em or span element:

The text “dolor sit amet” will be rendered as emphasized.

Superscript

sup element:

Subscript

sub element:

Other styles can be applied with CSS.

Go to the CSS Text Styles cheatsheet

List

[hook]

Ordered

li (list) elements embedded into ol (ordered list) element:

Unordered

li (list) elements embedded into ul (unordered list) element:

Multi-level ordered and/or unordered list

li elements embedded into ol or ul element can contain additional ol or ul elements (with li elements inside of them):

[hook]

a (anchor) element:

The href (hyperreference) attribute defines the URL of the page which the browser should go to when the link is clicked.

The target attribute defines how to open the linked page. The _blank value means the page should always open in new tab (or sometimes in new window, depending on browser settings). The blank value is almost the same but it reuses the previously opened tab (or window). If no target attribute is provided the page will be opened in the same tab where the link is clicked.

Table

[hook]

table: the table itself
caption: title of the table
thead: header (first, highlighted row) of the table
tr: table row
th: a cell with highlighted text which describes what's the column for
tbody: the body (main part) of the table which contains the actual data
td (table data): a cell of body which contains a piece of data