HTML <p> Tag Definition, Usage and Examples

The <p> HTML Tag is used to show a paragraph. Blank lines or first-line indentation typically define paragraphs in visual media, but HTML paragraphs can be any structural grouping of related material, including images and form fields. For example, paragraphs will automatically close when another block-level element is parsed before the concluding </p> HTML Tag, which is a notable feature. The <p> HTML Tag is part of the basic HTML category in HTML Element Reference. The attributes of the <p> HTML Tag are global attributes and event attributes. 

<p> code block example to learn how it works is given below. 

<p>Paragraph</p>

The second example usage of the “<p>” code block examples is given below. 

<p>Facebook is accessible from any device that has Internet access, including personal computers, tablets, and smartphones. Users.......</p>
<p>Facebook has frequently come under criticism for issues such as user privacy.....</p>

What is <p> HTML Tag?

The <p> HTML Tag can be used to display a paragraph on the web. Blank lines or a first-line indentation are usually used to define paragraphs in visual media. HTML paragraphs can be any structural grouping of related material, such as images and form fields, and they can be used to group together content.

How to Use <p> HTML Tag?

To use <p> HTML Tag, the web developer should insert a paragraph between the <p> and </p> HTML Tags. Browsers automatically add a single blank line before and after each <p> HTML Tag, so there is always a blank line before and after it.

Example Usage of <p> HTML Tag?

The following examples of usage of <p> HTML Tag are given below. 

<p>A web browser is computer software that enables users to visit the World Wide Web or a local website.</p>
<p>A web browser is not synonymous with a search engine....</p>

What are the Attributes of <p> HTML Tag?

There are multiple attributes for the <p> HTML Tag. The following attributes are listed below.

  • Global Attributes: The <p> HTML Tag supports global attributes. All HTML elements, even those not specified in the standard, can have global attributes. This means that any non-standard elements must nevertheless allow certain characteristics, even if using such elements makes the content non-HTML5 compliant.
  • Event Attributes: The <p> HTML Tag supports event attributes. The Event Attributes always have a name that begins with “on” and is followed by the name of the event for which it is intended. They specify a script to run when an event of the defined type is dispatched to the element with the specified attributes.

What is the Default CSS Setting for <p> HTML Tag?

The following is the Default CSS Setting for the <p> HTML Tag.

p {
    margin: 10px 0;
    padding: 5px;
    border: 1px solid #999;
}

What are the Related other HTML Tags to <p>?

The other related HTML Tags to <p> HTML Tag are listed below.

  • <comment> HTML Tag: The <comment> HTML Tag is related to <p> HTML Tag because they are both in basic HTML Tags. The <comment> HTML Tag is used to insert comments into the main HTML code file.
  • <doctype> HTML Tag: The <doctype> HTML Tag is related to <p> HTML Tag because they are both in basic HTML Tags. The <doctype> HTML Tag informs the browser about the HTML version.
  • <title> HTML Tag: The <title> HTML Tag is related to <p> HTML Tag because they are both in basic HTML Tags. The <title> HTML Tag is used to define the page’s title.
  • <body> HTML Tag: The <body> HTML Tag is related to <p> HTML Tag because they are both in basic HTML Tags. The <body> HTML Tag is used to define the body of a web page.
Holistic SEO
Follow SEO

4 thoughts on “HTML <p> Tag Definition, Usage and Examples”

Leave a Comment

HTML <p> Tag Definition, Usage and Examples

by Holistic SEO time to read: 3 min
4