Formatting Tags in HTML

HTML FORMATTING TAG

HTML provides a variety of formatting tags that allow you to control the visual presentation of text and content on a web page. Here are some common formatting tags in HTML:

  1. Bold Text (<b>): Use the <b> tag to make text bold.
Example: 

<p>This is <b>bold text</b>.</p>

2. Italic Text (<i>): The <i> tag is used to italicize text.

Example: 

<p>This is <i>italicized text</i>.</p>

3. Underline Text (<u>): The <u> tag underlines text.

Example: 

<p>This is <u>underlined text</u>.</p>

4. Strikethrough Text (<s> or <strike> or <del>): These tags are used to create strikethrough text.

Example: 

<p>This is <s>strikethrough text</s>.</p>

5. Superscript (<sup>) and Subscript (<sub>) Text: These tags are used to create superscript and subscript text, respectively.

Example: 1

<p>E = mc<sup>2</sup></p>

Example: 2 

<p>H<sub>2</sub>O</p>

6. Line Break (<br>): The <br> tag is used to insert a line break within text.

Example:

<p>This is the first line.<br>This is the second line.</p>

7. Horizontal Rule (<hr>): The <hr> tag creates a horizontal line to visually separate content.

Example:

<p>This is above the line.</p>
<hr>
<p>This is below the line.</p>

8. Preformatted Text (<pre>): The <pre> tag preserves whitespace and line breaks, rendering text exactly as it appears in the source code.

Example: 

<pre>
This   is   preformatted
text.
</pre>

9. Blockquote (<blockquote>): The <blockquote> tag is used to indicate a block of quoted text.

Example:

<blockquote>
"To be or not to be, that is the question."
</blockquote>

These formatting tags can be used to enhance the visual appearance of your content in HTML.

Leave a comment