HTML Formatting Elements

HTML text formatting elements are used to manipulate the appearance and style of text within a web page. These elements allow you to apply various text formatting options, such as making text bold, italic, underlined, or specifying the font size. Here are some common HTML text formatting elements:

<b> - Bold text
<strong> - Important text
<i> - Italic text
<em> - Emphasized text
<mark> - Marked text
<small> - Smaller text
<del> - Deleted text
<ins> - Inserted text
<sub> - Subscript text
<sup> - Superscript text

Here’s an explanation of each of the HTML formatting elements :

1. <b> – Bold text :
The <b> element is used to make text bold. It doesn’t carry any specific semantic meaning but is simply used for visual styling.

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

2. <strong> – Important text:
The <strong> element is used to represent strong importance, and browsers typically render the text in bold. It has a semantic meaning of importance, making it suitable for screen readers.

<p>This is <strong>strong</strong> text.</p>

3. <i> – Italic text:
The <i> element is used to make text italic. Similar to <b>, it doesn’t carry semantic meaning and is primarily used for styling.

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

4. <em> – Emphasized text :The <em> element is used to represent text with emphasized meaning, and browsers typically render the text in italics. It carries semantic importance for emphasis.

<p>This is <em>emphasized</em> text.</p>

5. <mark> – Marked text:
The <mark> element is used to highlight parts of text, often used for search results or keyword highlighting.

<p>This is <mark>highlighted</mark> text.</p>

6. <small> – Smaller text:
The <small> element is used to make text appear smaller than the surrounding text.

<p>This is <small>small</small> text.</p>

7 .<del> – Deleted text:
The <del> element represents deleted or struck-through text. It visually displays text with a strikethrough.

<p>This is <del>deleted</del> text.</p>

8. <ins> – Inserted text:
The <ins> element represents inserted or underlined text. It visually displays text with an underline.

<p>This is <ins>inserted</ins> text.</p>

9 . <sub> – Subscript text:
The <sub> element is used for subscript text, typically used for mathematical or chemical formulas.

H<sub>2</sub>O (Water)

10 . <sup> – Superscript text:

The <sup> element is used for superscript text, often used for footnotes or exponentiation.

x<sup>2</sup> (x squared)

These formatting elements provide a way to convey different visual and semantic meanings in the presentation of text content on a webpage. Keep in mind that the semantic elements (<strong>, <em>, <del>, <ins>, <sub>, <sup>) are preferred when applicable, as they convey both visual styling and meaningful structure to assistive technologies like screen readers.

Leave a Reply

Your email address will not be published. Required fields are marked *