HTML Formatting Tags

Practice Program 1. Bold Tag <b>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Bold Tag</title>
</head>
<body>

    <b>This text is bold.</b>

</body>
</html>

				
			

Practice Program 2. Strong Tag <strong>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Strong Tag</title>
</head>
<body>

    <strong>This is important text.</strong>

</body>
</html>

				
			

Practice Program 3. Italic Tag <i>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Italic Tag</title>
</head>
<body>

    <i>This text is italic.</i>

</body>
</html>

				
			

Practice Program 4. Emphasis Tag <em>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Emphasis Tag</title>
</head>
<body>

    <em>This text is emphasized.</em>

</body>
</html>

				
			

Practice Program 5. Underline Tag <u>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Underline Tag</title>
</head>
<body>

    <u>This text is underlined.</u>

</body>
</html>

				
			

Practice Program 6. Mark Tag <mark>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Mark Tag</title>
</head>
<body>

    <mark>This text is highlighted.</mark>

</body>
</html>

				
			

Practice Program 7. Small Tag <small>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Small Tag</title>
</head>
<body>

    <small>This is small text.</small>

</body>
</html>

				
			

Practice Program 8. Big Tag <big>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Big Tag</title>
</head>
<body>

    <big>This is big text.</big>

</body>
</html>

				
			

Practice Program 9. Deleted Tag <del>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Deleted Tag</title>
</head>
<body>

    <del>Deleted Text</del>

</body>
</html>

				
			

Practice Program 10. Inserted Tag <ins>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Inserted Tag</title>
</head>
<body>

    <ins>Inserted Text</ins>

</body>
</html>

				
			

Practice Program 11. Strike Tag <s>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Strike Tag</title>
</head>
<body>

    <s>Strike-through Text</s>

</body>
</html>

				
			

Practice Program 12. Strike Tag <strike>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Strike Tag</title>
</head>
<body>

    <strike>Old Strike Text</strike>

</body>
</html>

				
			

Practice Program 13. Superscript Tag <sup>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Superscript Tag</title>
</head>
<body>

    x<sup>2</sup>

</body>
</html>

				
			

Practice Program 14. Subscript Tag <sub>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Subscript Tag</title>
</head>
<body>

    H<sub>2</sub>O

</body>
</html>

				
			

Practice Program 15. Teletype Tag <tt>

				
					<!DOCTYPE html>
<html>
<head>
    <title>TT Tag</title>
</head>
<body>

    <tt>Teletype Text</tt>

</body>
</html>

				
			

Practice Program 16. Code Tag <code>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Code Tag</title>
</head>
<body>

    <code>console.log("Hello");</code>

</body>
</html>

				
			

Practice Program 17. Keyboard Tag <kbd>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Keyboard Tag</title>
</head>
<body>

    Press <kbd>Ctrl</kbd> + <kbd>C</kbd>

</body>
</html>

				
			

Practice Program 18. Sample Tag <samp>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Sample Tag</title>
</head>
<body>

    <samp>Output: Success</samp>

</body>
</html>

				
			

Practice Program 19. Variable Tag <var>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Variable Tag</title>
</head>
<body>

    <var>x</var> = 10

</body>
</html>

				
			

Practice Program 20. Preformatted Tag <pre>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Pre Tag</title>
</head>
<body>

<pre>
Name : Rahul
City : Delhi
</pre>

</body>
</html>

				
			

Practice Program 21. Abbreviation Tag <abbr>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Abbreviation Tag</title>
</head>
<body>

    <abbr title="HyperText Markup Language">
        HTML
    </abbr>

</body>
</html>

				
			

Practice Program 22. Acronym Tag <acronym>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Acronym Tag</title>
</head>
<body>

    <acronym title="World Health Organization">
        WHO
    </acronym>

</body>
</html>

				
			

Practice Program 23. Citation Tag <cite>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Citation Tag</title>
</head>
<body>

    <cite>The Wings of Fire</cite>

</body>
</html>

				
			

Practice Program 24. Blockquote Tag <blockquote>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Blockquote Tag</title>
</head>
<body>

    <blockquote>
        Learning HTML is easy.
    </blockquote>

</body>
</html>

				
			

Practice Program 25. Quote Tag <q>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Quote Tag</title>
</head>
<body>

    <q>Practice daily for success.</q>

</body>
</html>

				
			

Practice Program 26. Address Tag <address>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Address Tag</title>
</head>
<body>

    <address>
        Hari Nagar, New Delhi
    </address>

</body>
</html>

				
			

Practice Program 27. Definition Tag <dfn>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Definition Tag</title>
</head>
<body>

    <dfn>HTML</dfn> is a markup language.

</body>
</html>

				
			

Practice Program 28. Time Tag <time>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Time Tag</title>
</head>
<body>

    <time>10:30 AM</time>

</body>
</html>

				
			

Practice Program 29. Span Tag <span>

				
					<!DOCTYPE html>
<html>
<head>
    <title>Span Tag</title>
</head>
<body>

    <span style="color:red;">
        Colored Text
    </span>

</body>
</html>

				
			

Practice Program 30. Line Break Tag <br>

				
					<!DOCTYPE html>
<html>
<head>
    <title>BR Tag</title>
</head>
<body>

    HTML<br>
    CSS<br>
    JavaScript

</body>
</html>

				
			

Practice Program 31. Horizontal Rule Tag <hr>

				
					<!DOCTYPE html>
<html>
<head>
    <title>HR Tag</title>
</head>
<body>

    HTML
    <hr>
    CSS

</body>
</html>

				
			

Complete Program Covering All HTML Formatting Tags

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

    <h1>HTML Formatting Tags Demonstration</h1>

    <hr>

    <b>Bold Text Example</b>
    <br><br>

    <strong>Strong Important Text</strong>
    <br><br>

    <i>Italic Text Example</i>
    <br><br>

    <em>Emphasized Text Example</em>
    <br><br>

    <u>Underlined Text Example</u>
    <br><br>

    <mark>Highlighted Text Example</mark>
    <br><br>

    <small>Small Text Example</small>
    <br><br>

    <big>Big Text Example</big>
    <br><br>

    <del>Deleted Text Example</del>
    <br><br>

    <ins>Inserted Text Example</ins>
    <br><br>

    <s>Strike-through Text Example</s>
    <br><br>

    <strike>Old Strike Tag Example</strike>
    <br><br>

    x<sup>2</sup> + y<sup>2</sup>
    <br><br>

    H<sub>2</sub>O
    <br><br>

    <tt>Teletype Text Example</tt>
    <br><br>

    <code>
        console.log("Hello World");
    </code>
    <br><br>

    Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy.
    <br><br>

    <samp>
        Output: Program Executed Successfully
    </samp>
    <br><br>

    The value of <var>x</var> is 10.
    <br><br>

<pre>
Name   : Rahul Kumar
Course : Web Development
City   : Delhi
</pre>

    <abbr title="HyperText Markup Language">
        HTML
    </abbr>
    <br><br>

    <acronym title="World Health Organization">
        WHO
    </acronym>
    <br><br>

    <cite>The Wings of Fire</cite>
    <br><br>

    <blockquote>
        Education is the most powerful weapon
        which you can use to change the world.
    </blockquote>

    <q>Practice makes perfect.</q>
    <br><br>

    <address>
        Sun Foundation<br>
        Hari Nagar, New Delhi<br>
        India
    </address>

    <br>

    <dfn>HTML</dfn> is the standard markup language for webpages.
    <br><br>

    Current Date and Time:
    <time>2026-05-18 02:30 PM</time>
    <br><br>

    This is a
    <span style="color:red;">
        colored text using span tag
    </span>

    <hr>

    End of Formatting Tags Example

</body>
</html>