HTML paragraphs


Notations:
  • Paragraphs in HTML starts from <p> and ends from </p>.
  • Paragraph element works even if we do not give end tags but as recommended one must use end tags.
  • After each word <p> element leaves only one space no matter how much space we leave in HTML while typing text in <p> element.
  • To display text as it is one must use <pre> element described below.

Example:

<!DOCTYPE html>
<html>
<head>
<title>
Paragraphs in HTML </title>
</head>
<body>
<p>
Hello guys my name is Ashutosh.</p>
</body>
</html>

Output:

Hello guys my name is Ashutosh.

Difference between <p> and <pre> tags:


Example for <p>:

<!DOCTYPE html>
<html>
<head>
<title>
Difference between para and pre element. </title>
</head>
<body>
<p>
Betty butter bought some bitter butter,
Then Baby Butter bought some more butter,
To make bitter butter better butter.
</p>
</body>
</html>

Output:

Betty butter bought some bitter butter, Then Baby Butter bought some more butter, To make bitter butter better butter.

Example for <pre>:

<!DOCTYPE html>
<html>
<head>
<title>
Difference between para and pre element. </title>
</head>
<body>
<pre>
Betty butter bought some bitter butter,
Then Baby Butter bought some more butter,
To make bitter butter better butter.
</pre>
</body>
</html>

Output:

Betty butter bought some bitter butter,
Then Baby Butter bought some more butter,
To make bitter butter better butter.