HTML Paragraph (P Tags)

The p tag is used to publish any text on a web page. <p> is its start tag and </p> is its end tag. You can put any text inside this start and end tag. This text will appear in the browser in paragraph form.


such as:

<p>When a browser sees the "<p>" tag for a new paragraph, it usually adds one blank line and some extra vertical space before starting the new section.</p>


Attributes can be used in this tag, such as the following attributes commonly used: align, class, id, style, and title. Besides, event attributes onmouseover, onclick etc can be used.


Using the class and id attributes, not only this p element but almost all elements can be named, and CSS is styled with that name. Here are some implementations of the align, title and style attributes.


<p align="right">Most browsers align a new paragraph to the left by default.</p>

<p align="center">To change this, use the "<p>" tag's "align" attribute, which gives you four ways to align content: left, right, center, and justify.</p>

<p style="background-color:#f00;" title="This is title tooltip">You can only put a paragraph in a block with other paragraphs, lists, forms, and preformatted text.</p>


Only p tags examples are given here to save time. <body></body> contains these elements and must follow the complete structure of the HTML document. That is, they must be placed inside a full HTML document structure. As mentioned in the Doc Type tutorial.