HTML

HTML Paragraphs and Text Formatting


3. Paragraphs and Text Formatting

  • <p> is used for creating paragraphs of text.
  • <br> inserts a line break.
  • <hr> represents a thematic break or a horizontal rule.
  • <em> is for emphasizing text.
  • <strong> is for strongly emphasizing text.
  • <mark> is used to highlight text.
  • <small> represents smaller text.
  • <sub> and <sup> are for subscript and superscript text, respectively.
  • <del> represents deleted or struck-through text.
  • <ins> represents inserted or underlined text.
  • <u> represents underlined text (though it's not recommended to use; prefer CSS for styling).
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML Tags Example</title>
</head>
<body>

    <p>This is a simple paragraph of text.</p>

    <p>
        This paragraph includes a line break.<br>
        The text continues on a new line after the break.
    </p>

    <hr>

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

    <p>
        <strong>This text is strongly emphasized.</strong>
    </p>

    <p>
        This paragraph contains some <mark>highlighted</mark> text.
    </p>

    <p>
        <small>This text is smaller than the regular text.</small>
    </p>

    <p>
        H<sub>2</sub>O is an example of subscript text.
        E = mc<sup>2</sup> is an example of superscript text.
    </p>

    <p>
        <del>This text is deleted or struck-through.</del>
    </p>

    <p>
        <ins>This text is inserted or underlined.</ins>
    </p>

    <p>
        <u>This text is underlined.</u> <!-- Note: It's generally not recommended to use <u> for styling; prefer CSS. -->
    </p>

</body>
</html>