HTML paragraph tag

How do you use the paragraph tag in HTML?

The <p></p> tags use for making new paragraphs. You can also define paragraph's alignment with align attributes. Align attribute has three values such as left, center and right. If you do not write align attribute then by default it remain left. Code


<html>
    <head>
    </head>
    <body>
        <p>
            Paragraph text
        </p>
    </body>
</html>
Output

Paragraph text

If you want to make alignment center of any paragraph so you can do it with the help of align attribute of <p></p> tag. Example is mentioned below:

Code

<html>
    <head>
    </head>
    <body>
        <p align='center'>
            Paragraph text
        </p>
    </body>
</html>
Output

Paragraph text

If you want to make alignment right of any paragraph so you can do it with the help of align attribute of <p></p> tag. Example is mentioned below:

Code


<html>
    <head>
    </head>
    <body>
        <p align='right'>
            Paragraph text
        </p>
    </body>
</html>


Output

Paragraph text

FAQ 1. What is the default alignment of an HTML paragraph? By default, paragraph text generally follows the left-to-right text direction of the document. For a standard English-language webpage, the text is normally aligned to the left. 2. Can I change the color of an HTML paragraph? Yes, you can change paragraph text color using the CSS color property. For example, color: blue; displays the paragraph text in blue. 3. How can I change the font size of a paragraph? Use the CSS font-size property to change the size of paragraph text. You can specify values in pixels, rem, em, or other supported CSS units.