SHARE

HTML <p> Tag Definition

<p> tag is used to define a paragraph in HTML web page . This tag is also need to close with </p> .This tag is only used between <body> </body> tags .

Example

<html>
<head>
</head>
<body>

<p> This is paragraph Text</p>

</body>
</html>

Support

<p> Tag support all web browsers

Attributes

<p> Tag support align attribute to change alignment of paragraph .

Example

<p attr="left"> </p>  Not valid in HTML 5 . Valid only with old HTML versions to align para to left<p attr="right"> </p> This value is used to align paragraph to  right<p attr="center"> </p> This value is used to align paragraph to  Center<p attr="left"> </p> This value is used to stretches the lines so that each line has equal width

Style With CSS

paragraph is DOM element .To style <p> tag with css ,use “p”  as selector .

Example

<html>
<head>
</head>
<style>
p {
text-align: center;
color: red;
}
</style>
<body>
<p> This is paragraph Text</p>
</body>
</html>