HTML p element

Html <p> tag defines paragraphs. paragraph always starts on a new line. This is a block level element.


<p>This is a single paragraph. It is a block level element</p>
 <p>This is a second paragraph as an example.</p>

Try </>

If you want to break a single line paragraph into multi line paragraphs, then You should use <br> element as a child of paragraph element.


<p>This is a single paragraph.<br> A line can be broken <br> into multiple lines.</p>
 <p>This is a second paragraph <br> where break occurs.</p>

Try </>

Tip: If more suitable elements are available to write the content, then we should not use paragraph element.

Note: List elements can not be the children of the paragraph element.

Tag omission

The closing tag (</p>) may be omitted.

Global Attributes

All the global attributes are applicable on the p tag.

If you want to know that what is the structure of the web page. And what kind of elements have been used to make the page? You can view page source. To view page source press right click then select view page source.

Was this article helpful?




Get the newsletter