How to define a paragraph in HTML5 ?
In this article, we define a paragraph by using a <p> element in the document. The <p> tag in HTML defines the paragraph. These have both opening and closing tags. So anything written within <p> and </p> is treated as a paragraph content. Most browsers read a line as a paragraph even if we don’t use the closing tag i.e. </p> but this may raise unexpected results. So, it is both a good convention and we must use the closing tag.
Syntax:
<p> Content... </p>
Example 1:
<!DOCTYPE html> <html> <head> <title> HTML5: How to define a paragraph? </title> </head> <body> <h2> GeeksForGeeks </h2> <h2> HTML5: How to define a paragraph? </h2> <p> A Computer Science portal for geeks. </p> <p> It contains well written, well thought articles. </p> </body> </html> |
chevron_right
filter_none
Output:

Example 2:
<!DOCTYPE html> <html> <head> <title> HTML5: How to define a paragraph? </title> </head> <body> <h2> GeeksForGeeks </h2> <h2> HTML5: How to define a paragraph? </h2> <p> This paragraph has multiple lines. But HTML reduces them to a single line, omitting the carriage return we have used. </p> <p> This paragraph has multiple spaces. But HTML reduces them all to a single space, omitting the extra spaces and line we have used. </p> </body> </html> |
chevron_right
filter_none
Output:

Supported Browsers:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari


