HTML Paragraphs
Group blocks of text into readable paragraphs.
Syntax
<p>Your text here.</p>The <p> element defines a paragraph. Browsers automatically add space above and below each paragraph.
The browser ignores extra spaces and line breaks in your code. Multiple spaces collapse into a single space.
Example
Loading editor…
Press Run to see the result.
When to use it
- A blogger wraps each paragraph of an article in <p> tags so the browser adds spacing between blocks of text.
- A developer uses <p> to contain a product description on an e-commerce card component.
- A content team marks up FAQ answers in <p> tags inside <details> elements for accessible accordion sections.
More examples
Basic paragraphs with spacing
Browsers render each <p> as a block with vertical margin, regardless of spacing in source code.
<p>HTML paragraphs are defined with the p element.</p>
<p>Each paragraph starts on a new line with automatic top and bottom margins.</p>
<p>You cannot change the display by adding extra spaces or lines in the HTML source.</p>Paragraph with inline formatting
Inline elements inside <p> add emphasis, importance, or links without breaking the paragraph flow.
<p>
This course covers <strong>HTML fundamentals</strong>,
<em>CSS styling</em>, and basic
<a href="/javascript">JavaScript</a>.
</p>Paragraphs inside an article
Multiple <p> elements inside <article> organize body text into readable, semantically grouped chunks.
<article>
<h2>Why Learn HTML?</h2>
<p>HTML is the foundation of every website you visit. Without it, browsers have no structure to display.</p>
<p>Learning HTML gives you the power to build and understand any web page from scratch.</p>
</article>
Discussion