HTML Tag






<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]
-->




HTML <p> Tag



Previous
Complete HTML Reference
Next



Example


A paragraph is marked up as follows:



<p>This is some text in a paragraph.</p>

Try it Yourself »

More "Try it Yourself" examples below.




Definition and Usage


The <p> tag defines a paragraph.


Browsers automatically add some space (margin) before and after each <p>
element. The margins can be modified with CSS (with the margin properties).




Browser Support



















Element
<p> Yes Yes Yes Yes Yes



Differences Between HTML 4.01 and HTML5


The align attribute is not supported in HTML5.




Attributes













Attribute Value Description
align left
right
center
justify

Not supported in HTML5.
Specifies the alignment of the text
within a paragraph






<!--
mid_content, all: [300,250][336,280][728,90][970,250][970,90][320,50][468,60]
-->





Global Attributes


The <p> tag also supports the Global Attributes in HTML.




Event Attributes


The <p> tag also supports the Event Attributes in HTML.





Try it Yourself - Examples



More paragraphs
Some default behaviors of paragraphs.



Poem problems
Examples of how you can NOT write a poem in HTML.




Related Pages


HTML tutorial: HTML Paragraphs


HTML DOM reference: Paragraph Object




Default CSS Settings


Most browsers will display the <p> element with the following default values:



Example



p {
    display: block;
    margin-top: 1em;
    margin-bottom: 1em;
    margin-left: 0;
    margin-right: 0;
}

Try it Yourself »




Previous
Complete HTML Reference
Next

Popular posts from this blog

Python Lists

Aion

JavaScript Array Iteration Methods