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.
The HTML <strong> element specifies text with a high level of importance. Bold text is typically used to indicate the content inside.
Smaller text can be specified by the HTML <small> element:
HTML <mark> Element
Marked or highlighted text is described by the HTML <mark> element when it comes to HTML formatting:
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
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
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:
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.
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.
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:
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
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:
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:
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.
HTML Text Formatting Elements
Makes text bold
Indicates which text should be highlighted
Describes the voice or mood of a text
Smaller text is defined by this property
Identifies important text
Subscripts are defined here
Describes superscripted text
Inserted text is defined
Text that has been deleted
Text that has been marked or highlighted
One conventional unit is added to the font size with this tag.
Strikethroughs can be drawn using this tag. (HTML5-incompatible)
A text is displayed in teletype with this tag. It is not compatible with HTML5.
Text written between this tag is underlined.
HTML Formatting For Text Uses
Following are five essential HTML formatting options for text:
<h6>tags to create headings of different levels, with
<h1>being the highest level.
- Bold and Italic:
<strong>tags to render text in bold.
<em>tags to render text in italics.
- 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
<ul>to create an unordered (bulleted) list.
<ol>to create an ordered (numbered) list.
<li>to define a list item within
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.