English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Reference

HTML: <p> tag

The HTML <p> tag defines a paragraph in an HTML document. This tag is also commonly referred to as the <p> element.

Online Example

The following code marks a paragraph:

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML p Tag Usage (Basic Tutorial Website oldtoolbag.com)</title>/title>
</head>
<body>
<h1>Heading 1</h1>
<p>This is the first paragraph that would appear under Heading 1.</p>
<p>This is the second paragraph.</p>/p>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Most browsers support the <p> tag at present.

Tag definition and usage instructions

<p> tag defines a paragraph.

<p> is the most commonly used block-level element.

Paragraphs defined with <p> tags have extra spacing before and after the tags.

The <p> element automatically creates some space before and after it. Browsers automatically add these spaces, and you can also specify them in the style sheet.

in HTML 4.01 and HTML5is

HTML 4.01The align attribute of the middle tag has been deprecated, the difference in HTML5This attribute is not supported.

Attribute

AttributeValueDescription
alignleft
right
center
justify
HTML5Not supported. HTML 4.01Deprecated. Not recommended. Use styles instead. Specifies the alignment of the text within the paragraph.

Global Attributes

<p> tag supports global attributes, see the complete attribute table HTML Global Attributes.

event attributes

<p> tag supports all HTML Event Attributes.

Related Articles

HTML Tutorial:HTML Paragraph