HTML Text Formatting
HTML comprises numerous tags to designed text with specific meanings. These elements allow us to structure and format the content in a way that conveys its significance and context.
HTML Formatting Elements
Formatting elements in HTML were created to present specific types of text with distinct styles and appearances. These elements enable us to emphasize, highlight, or stylize content to enhance its visual presentation:
<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
HTML <b> and <strong> Elements
The HTML <b>
element is utilized to display text in a bold format, but it does not carry any extra meaning or importance.
The HTML <strong>
element is used to emphasize text with strong importance. Usually, the content inside this element is displayed in bold to visually highlight its significance.
HTML <i> and <em> Elements
The HTML <i>
element is used to represent a portion of text with an alternate voice or mood. Generally, the content inside this element is displayed in italic format. This tag is commonly used to denote a technical term, a phrase from another language, a thought, a ship name, or similar expressions.
The HTML <em>
element is used to signify emphasized text. The content within this element is typically displayed in italic format. Notably, when read by a screen reader, the words enclosed in <em>
will be pronounced with verbal stress, adding emphasis to the text.
HTML <small> Element
The HTML <small>
tag is used to write
smaller text:
HTML <mark> Element
The HTML <mark>
tag shows the text more prominent
that should be marked or highlighted:
HTML <del> Element
The HTML <del>
element is used to indicate text that has been removed or deleted from a document. In most cases, browsers will display the deleted text with a line through it to visually represent the removal./p>
HTML <ins> Element
The HTML <ins>
element is utilized to indicate text that has been added or inserted into a document. Typically, browsers will display the inserted text with an underline to visually represent the addition.
HTML <sub> Element
The HTML <sub>
element is used to create subscript text. Subscript text is displayed half a character below the regular text line and may sometimes appear in a slightly smaller font. This element is commonly used for representing chemical formulas, such as H2O:
HTML <sup> Element
The HTML <sup>
element is utilized for creating superscript text. Superscript text appears half a character above the regular text line and may sometimes be displayed in a slightly smaller font. This element is commonly employed for footnotes, such as WWW[1]: