Text Formatting Tags Overview

Text Formatting Tags

1. Headings (<h1> to <h6>)

Headings are used to define the structure of your content, with <h1> being the highest (most important) level and <h6> being the lowest.

HTML Example:


<h1>This is an H1 heading</h1>
<h2>This is an H2 heading</h2>
<h3>This is an H3 heading</h3>
<h4>This is an H4 heading</h4>
<h5>This is an H5 heading</h5>
<h6>This is an H6 heading</h6>

Explanation:

This is an H1 heading

This is an H2 heading

This is an H3 heading

This is an H4 heading

This is an H5 heading
This is an H6 heading

2. Paragraph (<p>)

The <p> tag is used to define paragraphs of text. It automatically adds space before and after the paragraph.

HTML Example:

<p>This is a paragraph of text.</p>
<p>Here is another paragraph.</p>

Explanation:

This is a paragraph of text.

Here is another paragraph.

3. Line Break (<br>)

The <br> tag inserts a line break, which forces the text to start on the next line without adding extra space.

HTML Example:

This is some text.<br>This text starts on a new line.

Explanation:

This is some text.
This text starts on a new line.

4. Horizontal Rule (<hr>)

The <hr> tag inserts a horizontal line, which is used to separate content visually.

HTML Example:

This is some text.<hr>This text is after a horizontal rule.

Explanation:

This is some text.


This text is after a horizontal rule.

5. Bold (<strong> and <b>)

The <strong> tag is used to emphasize text strongly, making it bold. The <b> tag also makes text bold but is deprecated in favor of <strong> because it doesn't convey any extra importance or emphasis.

HTML Example:

<strong>This text is important and bold.</strong>
<b>This text is bold but not necessarily important.</b>

Explanation:

This text is important and bold.

This text is bold but not necessarily important.

6. Italic (<em> and <i>)

The <em> tag is used to emphasize text, making it italicized. The <i> tag also makes text italic but is deprecated in favor of <em> for the same reasons as <b>.

HTML Example:

<em>This text is emphasized and italic.</em>
<i>This text is italic but not necessarily emphasized.</i>

Explanation:

This text is emphasized and italic.

This text is italic but not necessarily emphasized.

Previous Next
Modern Footer