HTML Text Formatting

HTML Text Formatting provides various tags for text formatting to enhance the visual presentation of content on a webpage. You can make your text bold, italic, etc. by using some HTML tags. When creating web content, effective text formatting is important for improving readability and user experience. In this guide, we’ll explore various HTML tags that allow you to format text, making it visually attractive and semantically meaningful.

HTML text formatting can be categorized into two techniques:

  1. Logical Tags: These tags denote the logical or semantic value of the text. They convey meaning without directly affecting the visual appearance. Examples include <em> (for emphasis) and <strong> (for important content).
  2. Physical Tags: These tags directly impact the visual appearance of the text. They alter font styles, sizes, and other visual properties. Examples include <b> (for bold) and <i> (for italic).

Table of Content

  • HTML Formatting Elements
  • Making text Bold or Strong
  • Making text Italic or emphasize
  • Highlighting a Text
  • Making a text as Subscript or Superscript
  • Making text smaller
  • Striking through the text
  • Adding a Text
  • Supported Browsers

HTML Formatting Elements

TagsDescriptions
<i>Showcases italicized text.
<small>Renders text in a smaller font size.
<ins>Highlights added or inserted text.
<sub>Creates subscript text.
<strong>Emphasizes text with importance, often in bold.
<b>Displays text in a bold format.
<mark>Accentuates text with a background highlight.
<del>Strikes through text to signify deletion.
<em>Adds emphasis to text, commonly styled as italic.
<sup>Formats text as superscript.

Example of Text Formatting

HTML
<!DOCTYPE html>
<html>

<head>
    <title>
        HTML text formatting
    </title>
</head>

<body>
    <h2>Welcome To w3wiki</h2>

    <!--Text in Bold-->
    <b>Hello Beginner</b>
    <br>
  
      <!--Text in Strong-->
    <strong>Hello Beginner</strong>
    <br>
  
      <!--Text in Italic Text-->
    <i>Hello Beginner</i>
    <br>    
  
       <!--Text in Emphasized-->
    <em>Hello Beginner</em>
    <br>

      <!--Text in marked-->
    <mark>Hello Beginner</mark>
    <br>
  
      <!--Text in deleted-->
    <del>Hello Beginner</del>
    <br>
  
      <!--Text in inserted-->
    <ins>Hello Beginner</ins>
    <br>
  
      <!--Text in subscript-->
      <p><sub>Hello</sub> Beginner</p>
    <br>
  
      <!--Text in superscript-->
      <p><sup>Hello</sup> Beginner</p>
    <br>
</body>

</html>

Output:

Supported Browsers

  • Google Chrome 1
  • Microsoft Edge 12
  • Firefox 1
  • Opera 12.1
  • Safari 1

Contact Us