HTML Text Formatting Elements
In the Last chapter, We learned about HTML styles, By the help of HTML style attribute. HTML also defines special elements, for defining text with a special meaning. HTML uses elements like <i> and <b> for formatting bold text output and italic text output. HTML Text Formatting elements were designed to display special types of text in a HTML web Page.
Bold Text : The HTML < b > element defines bold text
Important Text : The HTML <strong> element defines strong or Important text
Italic Text : The HTML <i> element defines italic text
Emphasized Text : The HTML <em> element defines emphasized text
Marked Text : The HTML <mark> element defines highlighted text or marked text
Small Text : The HTML <small> element defines small text
Deleted Text : The HTML <del> element defines deleted (removed) of text
Inserted Text : The HTML <ins> element defines inserted (added) text
Subscripts Text The HTML <sub> element defines subscripted text :
Superscripts Text : The HTML <sup> element defines superscripted text
HTML Bold Text Formatting
The HTML <b> element defines bold text.
HTML CODE EXAMPLE : HTML Bold Text Formatting
HTML Strong Text Formatting
The HTML < strong> element defines strong text, with added semantic "strong" importance.
HTML CODE EXAMPLE : HTML Strong Text Formatting
HTML Italic and Emphasized Formatting
The HTML < i > element defines italic text and The HTML element defines emphasized text, with added semantic importance.
HTML CODE EXAMPLE : HTML Italic and Emphasized Formatting
Note : Browsers display < strong > as < b >, and < em > as < i >.
HTML Italic and Emphasized Formatting
However, there is a difference in the meaning of these tags: < b > and < i > defines bold and italic text,but and means that the text is "important".
HTML Small Formatting
The HTML < small > element defines small text.
HTML CODE EXAMPLE : HTML Small Formatting
HTML Marked Formatting
The HTML < mark > element defines marked or highlighted text.
HTML CODE EXAMPLE : The HTML < mark > element
HTML Deleted Formatting
The HTML < del > element defines deleted (removed) text.
HTML CODE EXAMPLE : HTML Deleted Formatting
HTML Inserted Formatting
The HTML < ins > element defines inserted (added) text.
HTML CODE EXAMPLE : HTML Inserted Formatting
HTML Subscript Formatting
The HTML < sub> element defines subscripted text.
HTML CODE EXAMPLE : HTML Subscript Formatting
HTML Superscript Formatting
The HTML < sup > element defines superscripted text.
HTML CODE EXAMPLE : HTML Superscript Formatting
| Tag | Description |
|---|---|
| <b> | Defines bold text |
| <em> | Defines emphasized text |
| <i> | Defines italic text |
| <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 |