Friday, July 26, 2024

HTML Text Formatting

HTML text formatting tags are used to change the appearance of text on a webpage. Common tags include <b> and <strong> for bold text, <i> and <em> for italic text, <u> for underlined text, and <mark> for highlighted text. These tags help emphasize and organize content, making it more readable and visually appealing. Proper use of text formatting enhances user experience and content comprehension.

Examples:

<p>This is <b>bold</b> and <strong>strong</strong> text.</p>

<p>This is <i>italic</i> and <em>emphasized</em> text.</p>

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

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


HTML Code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML Tutorial</title>
</head>
<body>
    <h1>HTML Text Formatting</h1>
    <p>HTML provides various elements to format text.</p>
    <p>This is <b>bold</b> and <strong>strong</strong> text.</p>
    <p>This is <i>italic</i> and <em>emphasized</em> text.</p>
    <p>This is <u>underlined</u> text.</p>
    <p>This is <mark>highlighted</mark> text.</p>

</body>
</html>

The Output of the above code:


HTML Tutorial

HTML Text Formatting

HTML provides various elements to format text.

This is bold and strong text.

This is italic and emphasized text.

This is underlined text.

This is highlighted text.