HTML Paragraphs


❮ Previous Next ❯

What is an HTML Paragraphs?

HTML Paragraphs is denoted by the <p> tag, define a section of text.
A paragraph always starts on a new line, and have some white space (a margin) before and after a paragraph.
Using paragraphs is important for making well-structured content on a web page.

Example

<p>Paragraph Text of webpages</p>
<p>Second Paragraph Text of webpages</p>
Try It »


Working of HTML Paragraphs

In HTML Paragraphs, browser will automatically remove any extra spaces or extra lines or new lines when the page is displayed.
HTML <br> element defines a line break, Use <br> to break a new line without starting new paragraph

Example

<p>A paragraph with     lots of    space,    space igonored by paragraph    element</p>

<p>A paragraph with extra or new line
=New line will be ignored and
sentence will display in continue single line</p>

<p>A paragraph to break line or use new line <br>
BR element used to break line or use new line<br>
A paragraph to break line or use new line <br>
</p>
Try It »


HTML <pre> Element

HTML <pre> element defines performatted text.
The text inside <pre> element is dispalyed as per you mention in coding.

Example

<pre>
Twinkle, twinkle, little star

How I wonder what you are

Up above the world so high

Like a diamond in the sky

</pre>
Try It »