HTML <p> tag
Example
A paragraph is marked up as follows:
<p>This is some text in a paragraph.</p>
|
Try it yourself! (more examples at the bottom of this page)
|
Definition and Usage
The <p> tag defines a paragraph.
The p element automatically creates some space before and after itself. The
space is automatically applied by the browser, or you can specify it in a style
sheet.
Browser Support
The <p> tag is supported in all major browsers.
Differences Between HTML and XHTML
All "presentation attributes" of the p element were deprecated
in HTML 4.01, and are not supported in XHTML 1.0 Strict DTD.
Optional Attributes
DTD indicates in which DTD the attribute is
allowed. S=Strict, T=Transitional, and F=Frameset.
Attribute |
Value |
Description |
DTD |
align |
left
right
center
justify |
Deprecated. Use styles instead.
Specifies the alignment of the text
within a paragraph |
TF |
Standard Attributes
id, class, title, style, dir, lang, xml:lang |
For a full description, go to Standard
Attributes.
Event Attributes
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup |
For a full description, go to Event Attributes.
Try-It-Yourself Demos
More paragraphs
Some of the default behaviors of paragraphs.
Poem problems
Example of how you can NOT write a poem in HTML.
|
|
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate is for developers who want to document their knowledge of JavaScript and the HTML DOM.
The XML Certificate is for developers who want to document their knowledge of XML, XML DOM and XSLT.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
The PHP Certificate is for developers who want to document their knowledge of PHP and SQL (MySQL).
|
|