Horje
HTML <p> Tag

The <p> tag makes a blank lines

Definition and Usage

The <p> tag defines a paragraph.

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

Browser Support

Global Attributes

The <p> tag also supports the Global Attributes in HTML.


Event Attributes

The <p> tag also supports the Event Attributes in HTML.

 


How to craete HTML <p> Tag

A Paragraph is marked up as follows.
index.html
Example: HTML
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>

Output should be:

How to craete HTML <p> Tag

How to create an Align text in a paragraph with CSS on HTML <p> Tag

This is some text in a paragraph.

index.html
Example: HTML
<p style="text-align:right">This is some text in a paragraph.</p>

Output should be:

How to create an Align text in a paragraph with CSS on HTML <p> Tag

How to create Style paragraphs with CSS on HTML <p> Tag

See the Example and Learn More.

index.html
Example: HTML
<!DOCTYPE html>
<html>
<head>
<style>
p {
  color: navy;
  text-indent: 30px;
  text-transform: uppercase;
}
</style>
</head>
<body>

<h1>Style paragraphs with CSS</h1>

<p>World Wrestling Entertainment is an American professional wrestling promotion. It is owned and operated by TKO Group Holdings, a majority-owned subsidiary of Endeavor Group Holdings.</p>

<p>Prior to September 2023, the company's majority owner was its executive chairman, third-generation wrestling promoter Vince McMahon, who retained a 38.6% ownership of the company's outstanding stock and 81.1% of the voting power. The current entity, which was originally named Titan Sports, Inc., was incorporated on February 21, 1980</p>

</body>
</html>

Output should be:

How to create Style paragraphs with CSS on HTML <p> Tag

What is More Example on paragraphs on HTML <p> Tag

See The Example and Learn More.

index.html
Example: HTML
<p>
This paragraph
contains a lot of lines
in the source code,
but the browser 
ignores it.
</p>

Output should be:

What is More Example on paragraphs on HTML <p> Tag

What is the Poem problems in HTML on HTML <p> Tag

Note that the browser simply ignores the line breaks in the source code!

index.html
Example: HTML
<p>
   My Bonnie lies over the ocean.
   My Bonnie lies over the sea.
   My Bonnie lies over the ocean.
   Oh, bring back my Bonnie to me.
</p>

Output should be:

What is the Poem problems in HTML on HTML <p> Tag

How to set Default CSS Settings on HTML <p> Tag

Most browsers will display the <p> element with the following default values.

index.html
Example: HTML
<!DOCTYPE html>
<html>
<head>
<style>
p {
  display: block;
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: 0;
  margin-right: 0;
}
</style>
</head>
<body>

<p>A p element is displayed like this:</p>

<p>This is a paragraph.</p>

<p>Change the default CSS settings to see the effect.</p>

</body>
</html>

Output should be:

How to set Default CSS Settings on HTML <p> Tag





Type:
Develop
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin


Read Article
https://develop.horje.com/learn/1434/reference