The <p> element is used for a paragraph of ordinary text. You will run into it while reading other people’s HTML, and it is useful to know what job it does before copying the code.
What does <p> mean?
A paragraph of ordinary text. The tag gives the browser a specific kind of content to work with. It is more helpful to choose a tag for its meaning than because of its default look.
Each p is a separate paragraph with its own meaning; browsers usually place space around it by default.
A working HTML example
Here is a small example you can place in an HTML page and inspect in your browser:
<article>
<h2>About this project</h2>
<p>This page explains how our community garden works.</p>
<p>Everyone can help grow vegetables and flowers.</p>
</article>
Reading the example
Find the <p> part first. Notice which elements are around it and how its content or attributes are connected to those other elements.
In this example, <p> appears alongside other semantic markup. That context is often just as important as the element itself.
The browser builds its document from these relationships. Any CSS changes appearance, while interactive JavaScript behavior must be provided separately when the example includes it.
When should you use it?
Use <p> when you want to a paragraph of ordinary text. A sensible example of this on a real website is the markup shown above; it gives the browser and accessibility tools a clearer job to work with.
Common companions are nearby semantic elements. Check the nesting requirements before moving the element into a different location.
Try it yourself
Change the example content to something from your own website, then check the rendered page and the browser inspector.
Common Beginner Mistakes
- Never place block structures such as another p or a div inside p.
- Picking
<p>only because it looks a certain way instead of checking what it means. - Forgetting to inspect the surrounding markup when an element does not behave as expected.
Key Takeaways
<p>helps a paragraph of ordinary text.- Each p is a separate paragraph with its own meaning; browsers usually place space around it by default.
- Start with meaningful markup, then add styling or scripting only when the page needs it.