HTML formatting elements help to style and format the content of a webpage. These tags improve readability and make important information stand out.
The <b> and
<strong> tags make text bold.
<b>Bold Text</b>
<strong>Important Text</strong>
The <i> and
<em> tags display text in italic style.
<i>Italic Text</i>
<em>Emphasized Text</em>
The <u> tag is used to underline text.
<u>Underlined Text</u>
The <s> and
<del> tags display text with a line through it.
<s>Old Price</s>
<del>Deleted Text</del>
The <sub> tag defines subscript text.
H<sub>2</sub>O
Output: H₂O
The <sup> tag defines superscript text.
X<sup>2</sup>
Output: X²
The <ins> tag defines inserted text.
<ins>Inserted Text</ins>
The <del> tag defines deleted text.
<del>Deleted Text</del>
The <small> tag displays smaller text.
<small>Small Text</small>
The <code> tag is used for programming code.
<code>echo "Hello World";</code>
The <kbd> tag defines keyboard input.
<kbd>Ctrl + C</kbd>
The <pre> tag preserves spaces and line breaks.
<pre>
Line 1
Line 2
Line 3
</pre>
The <blockquote> tag is used for long quotations.
<blockquote>
Knowledge is power.
</blockquote>
The <mark> tag highlights important text.
<mark>Highlighted Text</mark>
| Tag | Purpose |
|---|---|
| <b> | Bold Text |
| <strong> | Important Bold Text |
| <i> | Italic Text |
| <em> | Emphasized Text |
| <u> | Underline Text |
| <s> | Strikethrough Text |
| <sub> | Subscript Text |
| <sup> | Superscript Text |
| <small> | Small Text |
| <mark> | Highlight Text |
| <code> | Programming Code |
| <kbd> | Keyboard Input |
| <pre> | Preformatted Text |
| <blockquote> | Quotation |
<strong> and <b> make text bold.<em> and <i> make text italic.<mark> highlights important text.<sub> and <sup> are useful in science and mathematics.<code> and <pre> help display programming code.Which tag is used to highlight text in HTML?