p
Creates a paragraph of text. Use it for sentences that form one readable thought.
Learn HTML Paragraphs as a practical HTML text lesson with syntax, examples, common mistakes, accessibility notes and a live code lab.
HTML text basics
The p element represents a paragraph: a block of text that belongs together as one idea. It is one of the most common HTML elements, but it is also one of the easiest to misuse.
A paragraph is not a spacing tool. You do not add empty paragraphs to push content down. Spacing belongs in CSS. The p element is for actual text content.
Good paragraphs make a page easier to scan. They help readers, search engines and assistive technology understand where one thought ends and the next begins.
Creates a paragraph of text. Use it for sentences that form one readable thought.
A paragraph normally starts on a new line and takes the available width.
A p element should not wrap major layout blocks such as sections, cards, lists or headings.
Margins, line height and width are styling decisions. Do not fake them with empty p tags.
Syntax and meaning
The browser gives p elements default spacing, but the real meaning is the paragraph itself. Keep every paragraph focused on one idea.
<article> <h1>Learning HTML step by step</h1> <p>HTML gives a page structure before design or behavior is added.</p> <p>Each paragraph explains one idea, which makes the lesson easier to read.</p> </article>
<p>Learning HTML step by step</p> <p></p> <p></p> <p> HTML gives a page structure. <section>Do not put a section inside a paragraph.</section> </p>
Practical rules
These rules are the part that saves time in real projects. If the HTML meaning is clean, CSS, JavaScript, accessibility checks and search optimization become easier to reason about.
If the paragraph starts explaining a second subject, split it into a new paragraph.
Use CSS margin or padding for vertical space. Empty p elements create meaningless content.
A heading introduces a section. It does not belong inside a paragraph.
Long text becomes easier to read when paragraphs are short, focused and naturally grouped.
If every sentence is an item, a ul or ol is probably better than many paragraphs.
Line-height, max-width, color and spacing should be controlled in CSS, not by changing HTML meaning.
Production thinking
Text markup matters because browsers and assistive technology do not only see letters. They also read structure, emphasis, quotes, code and relationships between pieces of text.
Screen readers can move through paragraph text naturally when the page uses real text elements instead of layout hacks.
In CMS content, validate that editors cannot create empty paragraphs only to add space. Fix spacing in templates and CSS.
Search engines can understand clear paragraph text around headings better than keyword-stuffed fragments or repeated slogan blocks.
Live code lab
Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.
Mini assignment
Practice assignment
Try it yourself
Self-check
Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.