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

Learn more

P - HTML Element

A description of the HTML p element

Edited: 2017-02-07 16:40

The p element represents a paragraph, usually containing one or more sentences. A new paragraph can be created when there is a natural change of subject. It can be a good idea to keep paragraphs short, to avoid walls of text, and increase readability.

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 the 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.

The space between p elements, can be controlled with the CSS margin and padding properties.

<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.

Attributes

Attribute:Value:Description:
AttributesOther AttributesGlobal, I18n, Event