- HTML Basics
- HTML Home
- HTML Basics
- HTML Document Structure
- HTML Data Types
- HTML Attributes
- HTML Fonts
- HTML Headings
- HTML Character Entities
- HTML Horizontal Line
- HTML Line Break
- HTML Paragraph
- HTML Citation Definition
- HTML Quotations
- HTML Comments
- HTML Styles
- HTML Formatting
- HTML CSS
- HTML Tags
- HTML Basic Tags
- HTML All Tags
- HTML Root Tags
- HTML Metadata Tags
- HTML Section Tags
- HTML Head Heading Tags
- HTML Flow Tags
- HTML Phrasing Tags
- HTML Embedded Tags
- HTML Interactive Tags
- HTML Meta Tags
- HTML Texts
- HTML Text Formatting
- HTML Physical Style Text
- HTML Logical Style Text
- HTML Organizing Text
- HTML Arranging Text
- HTML Displaying Lists
- HTML List
- HTML Links Tables
- HTML Links URLs
- HTML Links
- HTML URL Encode
- HTML Tables
- HTML Images Colors
- HTML Images Colors
- HTML Images
- HTML Color Codes
- HTML Canvas
- HTML Backgrounds
- HTML Forms
- HTML Forms
- HTML Form Tag
- HTML Input Tag
- HTML Button Tag
- HTML Multiple-Choice
- HTML Select Tag
- HTML Option Tag
- HTML Optgroup Tag
- HTML Textarea Label
- HTML Fieldset Legend
- HTML Datalist Tag
- HTML Keygen Tag
- HTML Output Tag
- HTML Progress Tag
- HTML Meter Tag
- HTML Submit Form
- HTML enctype Attribute
- HTML action Attribute
- HTML Method Attribute
- HTML Get Method
- HTML Post Method
- HTML Interactive
- HTML Interactive Web
- HTML Details Summary
- HTML Menu Tag
- HTML Command Tag
- HTML KBD Tag
- HTML Time Tag
- HTML Multimedia
- HTML Multimedia
- HTML Multimedia Tags
- HTML Audio Video
- HTML Embedded Multimedia
- HTML EMBED Tag
- HTML OBJECT Tag
- HTML FIGURE FIGCAPTION
- HTML Advance
- HTML Blocks
- HTML Classes
- HTML Iframes
- HTML JavaScript
- HTML Layouts
- HTML Responsive
- HTML Test
- HTML Online Test
- Give Online Test
- All Test List
HTML Paragraphs
HTML documents are divided into different paragraphs. Generally, a new paragraph is started by pressing the ENTER key.
However, in HTML, the browser does not understand the space created by the ENTER key. Therefore, a special element or tag i.e., P known as the paragraph element (P element) has to be inserted at the point from where we want to begin a new paragraph.
The paragraph tag is a container tag, which means it has both the opening <p> and the closing </p> tags.
Note - Browsers automatically add an empty line before and after a paragraph
HTML P Element Attributes
The following table describes attributes of the P element:
Attribute | Purpose |
---|---|
class | Defines the name of element |
dir | Defines the direction of the paragraph written from left to right or from right to left |
id | Defines the value of id |
lang | Defines the language in which the paragraph is written |
style | Defines an inline style of the element |
title | Provides an extra information about the element |
Onclick | Opens an HTML document on a mouse click |
Ondblclick | Opens an HTML document on a double-click |
Onkeydown | Opens an HTML document on pressing of a key |
Onkeypress | Opens an HTML document on pressing and releasing of the mouse button |
Onkeyup | Opens an HTML document when a key is released |
Onmousedown | Opens an HTML document on clicking of a mouse button |
Onmousemove | Opens and HTML document on moving of the mouse pointer |
Onmouseout | Opens an HTML document when the mouse pointer moves out of the document |
Onmouseover | Opens an HTML document when the mouse pointer moves over the element |
Onmouseup | Opens an HTML document on releasing of the mouse button |
HTML Paragraph Example
Here is an example of HTML paragraph:
<!DOCTYPE html> <html> <head> <title>HTML Paragraph Example</title> </head> <body> <p>This is a paragraph</p> <p>This is another paragraph</p> <p>This is the third paragraph</p> <p>You can create many paragraph as per your requirement using the <P> tag</p> </body> </html>
It will display the following result:

Here is another example also demonstrates paragraph in HTML:
<!DOCTYPE html> <html> <head> <title>HTML Paragraph Example</title> </head> <body> <p> This paragraph contains a lot of lines in the source code, but browser totally ignores it. </p> <p> This paragraph contains a lot of spaces and lines in the source code, but browser totally ignores it. </p> </body> </html>
Here is the sample output produced by the above HTML paragraph example code:

To write "as it is text" in HTML, you can use HTML pre tag. To learn in detail about pre tag, you can refer to HTML Basics Tags, there you will see the use of pre tag with examples.
Let's take another example on paragraph in HTML:
<!DOCTYPE html> <html> <head> <title>HTML Paragraph Example</title> </head> <body> <p>This is the first paragraph.</p> <p>This is the second paragraph.</p> <p>This is the third paragraph.</p> </body> </html>
Here is the output displayed by the above paragraph example in HTML:

« Previous Tutorial Next Tutorial »
Like/Share Us on Facebook 😋