HTML Formatting

In this tutorial you will learn about the HTML Formatting and its application with practical example.

HTML Formatting Tags enable us to organize the HTML Element in manner that enhance the readability of the webpage. Formatting tags allows us to define the proper format or structure for the information to be presented on the webpage. A well organized information is combination of heading, paragraph, listing element, space, line breaks etc.

Headings

HTML Heading tags are used to add heading element in a webpage, there are six level available for heading elements.

Example –

output:

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Paragraph

Paragraph can be created using <p></p> tag on webpage.

Example:

Output:

Here is a first paragraph of text.

Preserved Formatting

Sometimes we need a paragraph or text to keep its formatting as it is, this can be achieved using <pre> tag.

Example:

Output:

Centering Text

Text on a webpage can be aligned center using <center> tag.

Example:

Output:

 

 

 

This paragraph is aligned center.
 

 

 

Line Break

Line break (<BR>) tag is used to insert a break of one line in text or paragraph.

Example –

Output:

We are going to insert
line break.

Horizontal Rule

We can add a Horizontal Rule in webpage using <hr> tag.

Example:

Output:
We are going to insert horizontal rule…


…that was a horizontal rule.

Unordered List

Some times we need to represent the text in the form of list of items. An unordered list items can be created using <ul> tag.

Example:

Output:

  • Item 1
  • Item 2

Ordered List

A numbered list of items can be created using <ol> tag.

Example:

Output:

  1. Item 1
  2. Item 2

Some Basic Text Formatting

Example:

Output:

An example of Bold Text

An example of Emphasized Text

An example of Strong Text

An example of Italic Text

An example of superscripted Text

An example of subscripted Text

An example of struckthrough Text

An example of Computer Code Text

In this tutorial we have learn about the HTML Formatting and its application with practical example. I hope you will like this tutorial.