Skip to main content

HTML Text and Headings

HTML provides elements for displaying text, headings and page structure.

Headings Headings are used to organise content on a webpage.

HTML provides six heading levels.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6
Result:

Heading 1 Heading 2 Heading 3 Heading 4 Heading 5 Heading 6 Paragraphs Paragraphs are used for normal text content.

This is a paragraph.

This is another paragraph.

Result:

This is a paragraph.

This is another paragraph.

Bold Text Use the strong element to make text bold.

Important information Result:

Important information

Italic Text Use the em element to emphasise text.

Important information Result:

Important information

Line Breaks Use the br element to move text onto a new line.

Line One
Line Two Result:

Line One Line Two

Horizontal Lines Use the hr element to create a horizontal divider.


Result:

Subscript Subscript is commonly used in science and mathematics.

H2O Result:

H2O

Superscript Superscript is commonly used for powers and exponents.

x2 Result:

x2

Combining Elements Multiple text elements can be combined.

Science Report

Water is written as H2O.

The formula for area is x2.

Result:

Complete Example

<h1>Heading 1</h1>

<h2>Heading 2</h2>

<p>This is a paragraph.</p>

<strong>Bold text</strong>

<br><br>

<em>Italic text</em>

<hr>

H<sub>2</sub>O

<br>

x<sup>2</sup>
Quick Reference Headings

Heading 1

Heading 6
Paragraph

Paragraph text

Bold Bold text Italic Italic text Line Break
Horizontal Rule
Subscript Superscript You now know how to create headings and display text content in HTML.

Next tutorial: HTML Links and Images