HTML <p> tag
When writing in HTML (hypertext markup language), the <p> tag is a block element used to designate a paragraph. It is useful because Internet browsers add a bit of margin before after each element. The following sections contain information about this tag, including an example of it in use, and related attributes and browser compatibility.
The default margins around paragraphs should be adjusted using CSS (cascading style sheets).
Example of <p> code
<p>Hey, I'm a paragraph with some text in me.</p>
Example result
Hey, I'm a paragraph with some text in me.
Deprecated attributes
All HTML tags support standard attributes that define the settings of an HTML element. In addition to the standard settings, the <p> tag had the following unique attributes that are now deprecated.
Attribute | Description |
---|---|
align | Designates the alignment of the text within a paragraph. |
Compatibility
Edge | Internet Explorer | Firefox | Safari | Opera | Chrome |
---|---|---|---|---|---|
All versions | All versions | All versions | All versions | All versions | All versions |
Browser, Compatibility, Container tag, HTML <h1 to h6> tags, Paragraph, Web design terms