HTML Formatting For Text
The purpose of this article is to explore how text can be formatted in HTML and the tags that can be used to achieve a variety of effects. The ability to format HTML text is essential for creating visually stunning, user-friendly web pages, regardless of your level of experience.
It’s all about HTML formatting. There are several elements in HTML that can be used to specify text with a special significance to it.
This is a BOLD Text.
This is an Italic Text.
And this is subscript and superscript
HTML Formatting Elements
The following formatting elements were specifically created to present special types of text when we talk about HTML formatting:
<i>
– Italic text.<b>
– Bold text.<strong>
– Important 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
In HTML, the <b> element represents bold text, without any additional significance.
Example
The HTML <strong> element specifies text with a high level of importance. Bold text is typically used to indicate the content inside.
Example
Element <small>
Smaller text can be specified by the HTML <small> element:
Example
HTML <mark> Element
Marked or highlighted text is described by the HTML <mark> element when it comes to HTML formatting:
Example
HTML <big> Element
In HTML to make your font much larger than other text, put the content within <big>..</big>. There is a one-size-up increase in font size in HTML formatting. See example below
Example: 
HTML <u> Element
When we talk about HTML formatting in HTML to make your font underline than the other text, put the content within <u>..</u>. The text between it will be underlined. See example below
Example: 
HTML <del> Element
Documents with the <del> element indicate that text has been deleted. When text is deleted from a browser, a line is usually drawn across it:
Example
HTML <i> and <em> Elements
An HTML <i> element indicates a part of text in an alternative tone or mood. Italics are normally used to display the content inside.
Example
Emphasised text is defined by the HTML element <em>. Italics are usually used to show the content within.
You can pronounce the words in <em> with emphasis by stressing them verbally.
Example
HTML Formatting: HTML <ins> Element
An HTML element specified by the <ins> tag – indicates that some text has been added to a document. In most cases, the added text will be underlined by the browser when it comes to HTML formatting:
Example
HTML <sub> Element
Subscript text is defined by the HTML <sub> element. There is a gap between the normal line and subscript text, and the font may appear smaller when it appears below it.
Formulas like H2O:a can be represented with subscript text
Example
HTML <sup> Element
In HTML,the <sup> element defines superscript text. There is usually a half-character space above the normal line and sometimes a smaller font is used for superscript text as it comes to HTML formatting.
Footnotes can be made using superscript text, such as WWW[1]:
Example
HTML <strike> Element
Any text contained within <strike>..</strike> element is highlighted with a strikethrough. There is a thin line that crosses the statement. See the example below:
Example: 
HTML <tt> Element
For each letter to have the same width, write the content within the <tt>..</tt> element.
IMPORTANT: Variable-width fonts are known because each letter has a different width. (Ex. : ‘w’ is wider than ‘i’). Monospaced fonts provide similar spacing between every letter.
Example: 
HTML Text Formatting Elements
Tags | Overview |
---|---|
<b> | Makes text bold |
<em> | Indicates which text should be highlighted |
<i> | Describes the voice or mood of a text |
<small> | Smaller text is defined by this property |
<strong> | Identifies important text |
<sub> | Subscripts are defined here |
<sup> | Describes superscripted text |
<ins> | Inserted text is defined |
<del> | Text that has been deleted |
<mark> | Text that has been marked or highlighted |
<big> | One conventional unit is added to the font size with this tag. |
<strike> | Strikethroughs can be drawn using this tag. (HTML5-incompatible) |
<tt> | A text is displayed in teletype with this tag. It is not compatible with HTML5. |
<u> | Text written between this tag is underlined. |
HTML Formatting For Text Uses
Following are five essential HTML formatting options for text:
- Headings:
- Use
<h1>
to<h6>
tags to create headings of different levels, with<h1>
being the highest level.
- Use
- Bold and Italic:
- Use
<b>
or<strong>
tags to render text in bold. - Use
<i>
or<em>
tags to render text in italics.
- Use
- Underline and Strikethrough:
- Use the
<u>
tag to render text with an underline. - Use the
<s>
tag to render text with a strikethrough line.
- Use the
- Superscript and Subscript:
- Use the
<sup>
tag to format text as superscript (above the normal line). - Use the
<sub>
tag to format text as subscript (below the normal line).
- Use the
- Lists:
- Use
<ul>
to create an unordered (bulleted) list. - Use
<ol>
to create an ordered (numbered) list. - Use
<li>
to define a list item within<ul>
or<ol>
.
- Use
Conclusion
As we are discussing HTML formatting, the HTML text format provides a versatile and effective way of presenting text in a visually appealing and user-friendly manner. A variety of text formatting elements and tags are available in HTML to help you structure, emphasize, and clear your web content.
A web developer must master HTML text formatting regardless of whether they are creating a personal blog or a professional website. You can create web pages that are attractive, informative, and visually stunning using HTML text formatting with a bit of practice and experimentation.