HTML Paragraph
HTML paragraph or HTML p tag is used to define a paragraph in a webpage. Let's take a simple example to see how it work. It is a notable point that a browser itself add an empty line before and after a paragraph.
<p>This is first paragraph.</p>
<p>This is second paragraph.</p>
<p>This is third paragraph.</p>
Output:
This is first paragraph.
This is second paragraph.
This is third paragraph.
If you put a lot of spaces inside the HTML p tag, browser removes extra spaces and extra line while displaying the page. The browser counts number of spaces and lines as a single one.
<p>
I am
going to provide
you a paragraph tutorial on HTML
and hope that it will
be very beneficial for you.
</p>
<p>
Look, I put here a lot
of spaces but I know, Browser will ignore it.
</p>
<p>
You cannot determine the display of HTML</p>
<p>because resized windows may create different result.
</p>
Output:
I am going to provide you a tutorial on HTML and hope that it will be very beneficial for you.
Look, I put here a lot of spaces but I know, Browser will ignore it.
You cannot determine the display of HTML
because resized windows may create different result.
Note : All the extra lines and unnecessary spaces are removed by the browser.
Element | Chrome | IE | Firefox | Opera | Safari |
<h1> to <h6> | Yes | Yes | Yes | Yes | Yes |
HTML Line Breaks
The HTML <br> element defines a line break.
Use <br> if you want a line break (a new line) without starting a new paragraph:
<p>This is<br>a paragraph<br>with line breaks.</p>
The HTML <pre> element defines preformatted text.
The text inside a <pre> element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks:
<pre>
This Is My Paragraph Line.
This Is My Paragraph Line.
This Is My Paragraph Line.
This Is My Paragraph Line.
</pre>
Easytolearning tag reference contains additional information about HTML elements and their attributes.
Tag | Description |
---|---|
<p> | Defines a paragraph |
<br> | Inserts a single line break |
<pre> | Defines pre-formatted text |
© 2025 Easy To Learning. All Rights Reserved | Design by Easy To Learning