Text Tags

HTML Text Tags

We will look at some HTML elements that are used for displaying and formatting of text. The gallery below will show examples of the following tags.

  • Breaks and Paragraphs

  • Headings

  • Lists

Break Tags

The HTML <br> element produces a line break in text (carriage-return).

Sample HTML Code

Output from the HTML code.

Sample Replit Code

The above code can be viewed and executed on repl.it by clicking on the robot image

Paragraph Tags

The paragraph tag <p> is used to display a paragraph of text with an empty line afterwards.

Sample HTML Code

Output from HTML Code

Sample Replit Code

The above code can be viewed and executed on repl.it by clicking on the robot image

Headings

The HTML heading elements ( <h1> to <h6> ) are used to show six levels of section headings. <h1> is the largest heading with <h6> being the smallest.

Sample HTML Code

Output from the HTML code.

Sample Replit Code

The above code can be viewed and executed on repl.it by clicking on the robot image

Lists

There are two types of lists. Unordered and Ordered lists.

Unordered Lists

These lists are shown with bullet points such as:

  • Item 1

  • Item 2

  • Item 3

Ordered Lists

These lists are shown with numerical symbols such as:

  1. Item 1

  2. Item 2

  3. Item 3

Unordered Lists

Sample HTML Code

Output from the HTML code.

Sample Replit Code

The above code can be viewed and executed on repl.it by clicking on the robot image

Ordered Lists

Sample HTML Code

Output from the HTML code.

Sample Replit Code

The above code can be viewed and executed on repl.it by clicking on the robot image

Nested Lists

Lists can also be nested inside other lists

Sample HTML Code

Output from the HTML code.

Sample Replit Code

The above code can be viewed and executed on repl.it by clicking on the robot image