🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X
Questions


















Write a HTML program to implement Formatting tags.

Last Updated : 17 Jul 2025 New Question

Solution:

<!DOCTYPE html>
<html>
<head>
    <title>Formatting Tags Example</title>
</head>
<body>
    <h1>HTML Formatting Tags</h1>

    <p><strong>Bold Text:</strong> <strong>This text is bold.</strong></p>

    <p><em>Italic Text:</em> <em>This text is italicized.</em></p>

    <p><u>Underlined Text:</u> <u>This text is underlined.</u></p>

    <p><mark>Highlighted Text:</mark> <mark>This text is highlighted.</mark></p>

    <p><small>Small Text:</small> <small>This text is smaller than normal.</small></p>

    <p><del>Strikethrough Text:</del> <del>This text has a strikethrough.</del></p>

    <p><sub>Subscript Text:</sub> <sub>This text is subscript.</sub></p>

    <p><sup>Superscript Text:</sup> <sup>This text is superscript.</sup></p>

    <p><code>Inline Code:</code> <code>This is some inline code.</code></p>

    <p><blockquote>Blockquote:</blockquote>
    <blockquote>
        This is a blockquote. It's used to indicate a section that is being quoted from another source.
    </blockquote></p>

    <p><pre>Preformatted Text:</pre>
    <pre>
This is preformatted text.
    It preserves spaces and line breaks.
    </pre></p>
</body>
</html>

OUTPUT:

Code Explanation:

  • <strong>: Makes text bold.
  • <em>: Italicizes text.
  • <u>: Underlines text.
  • <mark>: Highlights text.
  • <small>: Renders text smaller.
  • <del>: Adds a strikethrough to text.
  • <sub>: Renders text as subscript.
  • <sup>: Renders text as superscript.
  • <code>: Displays text as inline code.
  • <blockquote>: Displays a block of quoted text.
  • <pre>: Displays preformatted text with preserved spacing and line breaks.
Report an error
Latest Updates