HTML Text Formatting
We can use some special tags to format the text as we want.
Some Formatting elements tags are:
<b> – Bold text
Example:
<b>This text is bold</b>
|
<strong> – Important text
Example:
<strong>This text is important!</strong>
|
<i> – Italic text
Example:
<i>This text is italic</i>
|
<em> – Emphasized text
Example:
<em>This text is emphasized</em>
|
<mark> – Marked text
Example:
<p>Do not forget to buy <mark>milk</mark> today.</p> |
<small> – Smaller text
Example:
<small>This is some smaller text.</small> |
<del> – Deleted text
Example:
<p>My favorite color is <del>blue</del> red.</p> |
<ins> – Inserted text
Example:
<p>My favorite color is <del>blue</del> <ins>red</ins>.</p> |
<sub> – Subscript text
Example:
<p>This is <sub>subscripted</sub> text.</p> |
<sup> – Superscript text
Example:
<p>This is <sup>superscripted</sup> text.</p> |
HTML Text Formatting Elements
Tag | Description |
---|---|
<b> | Defines bold text |
<em> | Defines emphasized text |
<i> | Defines a part of text in an alternate voice or mood |
<small> | Defines smaller text |
<strong> | Defines important text |
<sub> | Defines subscripted text |
<sup> | Defines superscripted text |
<ins> | Defines inserted text |
<del> | Defines deleted text |
<mark> | Defines marked/highlighted text |
<!DOCTYPE html> <html> <body> <p>This text is normal.</p> <p><b>This text is bold.</b></p> <strong>This text is important!</strong> <i>This text is italic</i> <em>This text is emphasized</em> <small>This is some smaller text.</small> <p>Do not forget to study <mark>math</mark> today.</p> <p>My favorite color is <del>lilac</del> black.</p> <p>My favorite color is <del>lilac</del> <ins>black</ins>.</p> <p>This is <sub>subscripted</sub> text.</p> <p>This is <sup>superscripted</sup> text.</p> </body> |
If you like the post HTML Text Formatting , please share your feedback!
For more HTML content visit HTML!
also see
C Programming language | Go Programming language |
Linked List | Array |
Simplification | Queue |
DBMS | Reasoning |
Aptitude | HTML |