Follow The New Tutorial updates on WhatsApp, Telegram or YouTube.

HTML Paragraph

<p> indicates the start of a new paragraph. The <p> tag in HTML defines a paragraph. Anything mentioned within <p> and </p> is treated as a paragraph.

Generally paragraph element is used to publish text on the web pages.

Syntax

<p> Content </p> 

Example

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTML Paragraph</title>
</head>

<body>
    <p>This is first paragraph.</p>
    <p>This is second paragraph.</p>
    <p>This is third paragraph.</p>
</body>

</html>

The <p> tag automatically adds space before and after any paragraph, which is basically margins added by the browser.

Browsers automatically add a single blank line before and after each <p> element.

Paragraphs are block-level elements, and notably will automatically close if another block-level element is parsed before the closing </p> tag.

A paragraph always starts on a new line.

Space inside HTML Paragraph

If you put a lot of spaces inside the HTML <p> tag, browser removes extra spaces and extra line while displaying the page. 

Example

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Space inside HTML Paragraph Example</title>
</head>

<body>
    <p>
        I am
        going to provide
        you a tutorial on HTML
        and hope that it will
        be very beneficial for you.
        HTML is very easy.
    </p>
    <p>
        Look, I put here a lot

        of spaces but I know, Browser will ignore it.
    </p>
    <p>
        You cannot determine the display of HTML</p>
    <p>because resized windows may create different result.
    </p>
</body>

</html>
Output of Space inside HTML Paragraph Example