HTML Text Formatting Elements
Last Updated :
29 May, 2023
As we know, HTML provides many predefined elements that are used to change the formatting of text. The formatting can be used to set the text styles (like - bold, italic, or emphasized, etc.), highlight the text, make text superscript and subscript, etc.
Text Formatting Elements:
<b> and <strong> Tags: Both tags are used to make text bold. The text content of the tag is shown as important information on the webpage.
Example: In this example, we will see the use of <b> and <strong> tags.
HTML
<!DOCTYPE html>
<html>
<head>
<title>Bold and strong</title>
</head>
<body>
<!--Normal text-->
<p>Normal Text</p>
<!--Text in Bold-->
<p><b>Bold Text</b></p>
<!--Text in Strong-->
<p><strong> Strong Text</strong></p>
</body>
</html>
Output:

HTML <i> and <em> Tags: Both tags are used to make the text italic and emphasized. Both the element has opening and closing tags.
Example: In this example, we will see the use of <i> and <em> tags.
HTML
<!DOCTYPE html>
<html>
<head>
<title>Italic and emphasized</title>
</head>
<body>
<!--Normal text-->
<p>Normal Text</p>
<!--Text in Italics-->
<p><i>The Text inside italic Tag</i></p>
<!--Text in Emphasize-->
<p><em>Emphasized Text</em></p>
</body>
</html>
Output:

HTML <small> and <big> Tags: The <small> tag is used to set a small font-size whereas the <big> tag is used to set a big font-size.
Example: In this example, we will see the use of <small> and <big> tags.
HTML
<!DOCTYPE html>
<html>
<head>
<title>Small and Big</title>
</head>
<body>
<!--Text in Normal-->
<p>Normal text</p>
<small>The text inside small Tag</small>
<p>
<big>The text inside big Tag</big>
</p>
</body>
</html>
Output:

HTML <sup> and <sub> Tags: The <sup> tag is used to superscript a text whereas the <sub> tag is used to subscript a text.
Example: In this example, we will see the use of <sup> and <sub> Tags
HTML
<!DOCTYPE html>
<html>
<head>
<title>Superscript and Subscript</title>
</head>
<body>
<!--Text in Normal-->
<p>Normal Text
<!--Text in Superscript-->
<p>
<sup>superscript </sup> Text
</p>
<!--Text in Subscript-->
<p>
<sub>subscript</sub>Text
</p>
</body>
</html>
Output:

HTML <ins> and <del> Tag: The <ins> tag is used to underline a text marking the part as inserted or added. It also has an opening and a closing tag. This tag is mainly used in text in place of deleted text whereas the <del> tag is used to delete the text it adds a strike line to the text.
Example: In this example, we will see the use of <ins> and <del> tags.
HTML
<!DOCTYPE html>
<html>
<head>
<title>Inserting and deleting</title>
</head>
<body>
<!--Deleting andText in Insert-->
<b>
<p>The TajMahal is located in
<del>Bombay</del>
<ins>Agra</ins>
</p>
</b>
</body>
</html>
Output:

HTML <mark> Tag: The <mark> tag is used to highlighting a text. It has an opening and closing tag.
Example: In this example, we will see the use of <mark> Tag.
HTML
<!DOCTYPE html>
<html>
<head>
<title>Highlight</title>
</head>
<body>
<!--Text in Normal-->
<p>Normal Text</p>
<!--Text in Highlight-->
<p>
<mark>Highlighted Text</mark>
</p>
</body>
</html>
Output:

Similar Reads
HTML Text Formatting HTML text formatting refers to the use of specific HTML tags to modify the appearance and structure of text on a webpage. It allows you to style text in different ways, such as making it bold, italic, underlined, highlighted, or struck-through. Table of ContentCategories of HTML Text FormattingLogic
4 min read
CSS Text Formatting CSS Text Formatting plays a crucial role in web design, allowing developers to control the visual presentation of text elements. Nearly 70% of a webpage's content is text, making effective formatting essential for readability and user engagement. CSS lets you adjust font properties, text alignment,
8 min read
HTML Elements An HTML Element consists of a start tag, content, and an end tag, which together define the element's structure and functionality. Elements are the basic building blocks of a webpage and can represent different types of content, such as text, links, images, or headings.For example, the <p> ele
5 min read
HTML File Format | .html Extension HTML, or Hyper Text Markup Language, is the most basic file that defines the structure of the web page to be displayed. HTML files can be loaded from local storage (file system) or fetched from the server by a browser.The HTML files are made up of elements like forms, texts, images, animations, etc.
3 min read
HTML Formatter HTML Formatter or Beautifier tools help make your HTML code clean and easy to read. They fix the spacing, line up elements properly, and highlight parts of the code, so it's easier to understand and work with. This makes your coding faster, cleaner, and easier to maintain.#content-iframe{width: 100%
3 min read