By using this site you agree to the use of cookies and related technologies.

Learn more

P - HTML Element

A description of the HTML p element

Edited: 2016-10-04 14:12

The p element represents a paragraph, usually containing one or more sentences. A new paragraph is typically created when there is a natural change of subject.

Each new line of text should be represented in its own paragraph, rather than using br to force the creation of linebreaks, this should allow for text to flow naturally on a page. There are cases where its fine to use br elements, but for main content you should generally avoid it.

Normally there will appear to be a small space between each p element, this is actually either a margin, or a padding, and it can be controlled with CSS.


Standard Attributes

AttributesOther AttributesGlobal, I18n, Event

HTML Paragraph Example:

<p>The happy cow was eating disgusting filthy grass from the ground, and it did not seem to mind at all. Chew, chew, chew.</p>
<p>I had never encountered such disgusting filthy grass before that day. It almost made me gag, right there on the spot.</p>

Paragraphs can typically be placed inside other block type elements and sectioning content such as div, article, header, footer, and others.

Do not place p's inside of inline type elements such as span, and a.