Friday, July 26, 2024

HTML Paragraphs

HTML paragraphs are used to group blocks of text, making the content more readable and organized. The <p> tag is used to define a paragraph. Browsers automatically add some space before and after paragraphs to separate them from other elements. Paragraphs can contain text, inline elements, and other nested tags. They are essential for structuring textual content on a webpage.

Examples:

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


<p>

  This paragraph contains <strong>bold</strong> and <em>italic</em> text to emphasize certain words.

</p>


<p>

  Here is a paragraph with a <a href="https://www.example.com">link</a> to another webpage.

</p>


HTML Code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HTML Tutorial</title>
</head>
<body>
    <h1>HTML Paragraphs</h1>
    <p>HTML paragraphs are defined with the <code>&lt;p&gt;</code> tag.</p>
    <pre>
        &lt;p&gt;This is a paragraph.&lt;/p&gt;
    </pre>
</body>
</html>

The Output of the above code:


HTML Tutorial - Page 6

HTML Paragraphs

HTML paragraphs are defined with the <p> tag.

        <p>This is a paragraph.</p>