HTML 5 <p> tag
Definition and Usage
The <p> tag defines a paragraph.
Differences Between HTML 4.01 and HTML 5
The align attribute, which was deprecated in HTML 4.01, is no longer
supported in HTML 5.
Tips and Notes
Tip: You should not use the <p> element when other elements are more
appropriate.
Example
Source |
Output |
<p>This is some text in a very short paragraph</p> |
This is some text in a very short paragraph |
Attributes
- 4: indicates if the attribute is defined in HTML 4.01
- 5: indicates if the attribute is defined in HTML 5
Attribute |
Value |
Description |
4 |
5 |
align |
left
right
center
justify |
Specifies the alignment of the text
within the paragraph. Not supported. Use CSS instead |
4 |
|
Standard Attributes
class, contenteditable, contextmenu, dir, draggable, id,
irrelevant, lang, ref, registrationmark, tabindex, template, title |
For a full description, go to Standard
Attributes in HTML 5.
Event Attributes
onabort, onbeforeunload, onblur, onchange, onclick,
oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave,
ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress,
onkeyup, onload, onmessage, onmousedown, onmousemove,
onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect,
onsubmit, onunload |
For a full description, go to Event Attributes
in HTML 5.
Try-It-Yourself Demos
Simple paragraphs
How paragraph elements are displayed
in the browser.
More paragraphs
Some of the default behaviors of paragraph elements.
Poem problems
Some problems with HTML formatting.
|
|
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).
|
|