Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

  1. Home
  2. HTML Tag Dictionary
  3. <p>

<p>

The <p> tag represents a paragraph. Use it to group a block of related text into a single paragraph. By default, browsers automatically add margin above and below each paragraph.

Syntax

<p>This is one paragraph.</p>
<p>This is another paragraph. Margin is added above and below automatically.</p>

Sample Code

<article>
  <h2>What is Programming?</h2>

  <!-- Use paragraphs to group blocks of text -->
  <p>Programming means writing instructions that tell a computer what to do.
  You write the steps in a language the computer understands (a programming language), and the computer executes them.</p>

  <p>There are many programming languages, including JavaScript, Python, PHP, and Swift.
  Each excels in different areas, so you choose the language that best fits your goal.</p>

  <!-- Inline elements can be placed inside a p tag -->
  <p>Beginners are recommended to start with <strong>HTML</strong> and <em>CSS</em>.
  See <a href="/tpl_rep.php?cat=html-beginner&fl=r1&lang=en">HTML Basics</a> for more details.</p>
</article>

Result

The three paragraphs are each displayed on their own line, with margin added automatically between them. In the third paragraph, "HTML" appears in bold, "CSS" appears in italics, and "HTML入門" appears as a link.

Notes

Because <p> is a block-level element, a line break is inserted before and after it automatically. If you need a line break within a paragraph, use the <br> tag — but to separate distinct paragraphs, writing separate <p> elements is the correct approach in HTML.

Inside a <p> tag, you can place inline elements such as text, links, images, and emphasis tags (<strong>, <em>). However, the HTML specification does not allow block-level elements (such as <div> or another <p>) to be nested inside a <p> tag. If you try to nest them, the browser will automatically close the tag for you.

Avoid using empty <p> tags or consecutive <br> tags just to add spacing. The correct way to control spacing is with the CSS margin and padding properties.

Browser Compatibility

Chrome Chrome
49+
Supported in all versions
Firefox Firefox
57+
Supported in all versions
Safari Safari
18+
Supported in all versions
Edge Edge
80+
11 or earlier ×
IE IE
11 or earlier ×
Opera Opera
48+
14 or earlier ×
iOS Safari iOS Safari
18+
Supported in all versions
Android Browser Android Browser
37+
4 or earlier ×
Chrome Android Chrome Android
36+
17 or earlier ×
Firefox Android Firefox Android
79+
3 or earlier ×

If you find any errors or copyright issues, please .