HTML Text formatting
HTML contains several elements for defining text with a special meaning.
Formatting elements were designed to display special types of text:
-
<b>
- Change Text to Bold -
<strong>
- Important Text -
<i>
- Change text to italic format -
<em>
- Emphasized Text -
<mark>
- Marked text which will highlight the text. -
<small>
- Change to Smaller text -
<del>
- Change text format to Deleted. -
<ins>
- Inserted text which will be identified by browser as inserted text. usually it will appear as underline. -
<sub>
-Subscript text which will appear next to the normal text before the element. -
<sup>
- Superscript text which will appear next to the normal text before the element.
Example of text formatting
<div>
<b>bold text</b>
<strong>Important text</strong>
<i>Italic text</i>
<em>Emphasized text</em>
<mark>Marked text</mark>
<small>Smaller text</small>
<del>Deleted text</del>
<ins>Inserted text</ins>
<sub>Subscript text</sub>
<sup>Superscript text</sup>
</div>
Example Result
bold text
Important text
italic text
Emphasized text
Marked text
Smaller text
Deleted text
Inserted text
Subscript text : x 2 y
Superscript text : x 2
Important text
italic text
Emphasized text
Marked text
Smaller text
Inserted text
Subscript text : x 2 y
Superscript text : x 2