👀 Live Preview
Two separate paragraphs with default block spacing:
First paragraph of sample text.
Second paragraph on its own line.

The <p> tag is the foundation of readable web text. This guide covers syntax, global attributes, common paragraph patterns, styling, and best practices for beginners.
Structure body text.
Starts on new line.
class, id, style.
Separate paragraphs.
Emphasize content.
SEO-friendly structure.
<p> Tag?The <p> tag is an essential HTML element used to define paragraphs of text. It provides a simple yet effective way to structure content, making it easy for both developers and browsers to understand and render text in a well-organized manner.
Every article, blog post, and landing page relies on <p> to break body copy into readable chunks with natural spacing.
Browsers treat <p> as a block-level element, so each paragraph starts on a new line and typically has top and bottom margin applied by default.
Enclose your text within opening <p> and closing </p> tags:
<p>Your paragraph text goes here.</p>p element — do not use br alone to fake paragraphs.div or another p) inside p.strong, em, and a are valid inside p.| Topic | Code Snippet | Notes |
|---|---|---|
| Basic paragraph | <p>Text here.</p> | Single block of text |
| Multiple paragraphs | Separate p tags | Browser adds spacing |
| CSS class | class="intro" | Global attribute |
| Inline style | style="font-size:16px" | Use CSS files instead |
| Display type | Block-level | Full width by default |
| Browser support | Universal | All browsers |
<p> vs <div>| Element | Purpose | When to use |
|---|---|---|
<p> | Paragraph of text | Body copy, descriptions |
<div> | Generic container | Layout, grouping non-text |
<br> | Line break inside text | Poetry, addresses — not paragraphs |
The <p> tag has no tag-specific attributes. It supports global HTML attributes such as class and style for styling:
<p class="highlight" style="font-size: 16px;">Your Styled Paragraph Here</p>class CSSApplies stylesheet rules to the paragraph.
class="intro"id TargetUnique identifier for links, scripts, or CSS.
id="summary"style InlineInline CSS declarations on the element.
style="color: red;"lang LanguageDeclares the language of the paragraph text.
lang="en"Write single paragraphs, stack multiple blocks, and style text with CSS classes.
Two separate paragraphs with default block spacing:
First paragraph of sample text.
Second paragraph on its own line.
The <p> tag structures textual content into readable paragraphs and supports styling through global attributes and CSS.
The primary purpose of p is to define a single paragraph of text within your HTML document.
<p>This is a simple paragraph of text.</p>Use multiple p tags to structure different paragraphs, aiding in the organization of your content.
<p>First paragraph.</p>
<p>Second paragraph.</p>Apply styles to your paragraphs using CSS to enhance the visual presentation of your content.
<p class="important-text">This paragraph is styled for emphasis.</p>strong and em over bare styling for emphasis.lang on paragraphs in a different language.p for body text beneath them.Wrap each text block in <p> opening and closing tags.
Each p displays as a block with default top and bottom margin.
Classes and styles adjust font, color, and spacing.
Structured paragraphs improve readability, accessibility, and SEO.
The <p> tag is supported in all major browsers, including every version of Internet Explorer.
Every browser renders <p> as a block-level text container.
Bottom line: Use <p> confidently in any browser for paragraph text.
The <p> tag is a cornerstone of HTML, enabling developers to create well-structured and visually appealing textual content. Utilize it effectively to convey information in a clear and organized manner, enhancing the overall user experience on your website.
p tagsstrong, em, and a inside paragraphsstylepbr tags instead of new paragraphspp for non-text containers<p>Bookmark these before you write body copy.
Core text block element.
BehaviorNew line + margin.
Layoutclass, id, style.
AttributesSeparate p per paragraph.
StructureClasses for emphasis.
DesignAll browsers ever.
Compatibilityclass, id, and style.<p> element for each paragraph.p are invalid HTML.Practice <p> with single, multiple, and styled paragraphs in the Try It editor.
6 people found this page helpful