The HTML paragraph tag: p explained. The paragraph tag
<p>
lets us make (define) new paragraphs.
Browsers automatically add some space (margin) before and after each element.
The margins can be modified with CSS (with the margin properties).
The opening tag is:
<p>
and the closing tag is:
</p>
Everything between the opening and closing paragraph tags:
<p>Hello World!</p>
is grouped together (in this case Hello World!)
Use a new:
<p>
tag every time you want a new paragraph.
Look at this example, where we’ve coded two paragraphs:
<body> <p>Hello world! Paragraph 1.</p> <p>This is my first webpage. Welcome. Paragraph 2.</p> </body>
Default CSS Settings for HTML p tag.
Most browsers will display the:
<p>
element with the following default values:
<!DOCTYPE html> <html> <head> <style> p { display: block; margin-top: 1em; margin-bottom: 1em; margin-left: 0; margin-right: 0; } </style> </head> <body> <p>A p element is displayed like this:</p> <p>This is a paragraph.</p> <p>Change the default CSS settings to see the effect.</p> </body> </html>
Another Paragraph tag example:
<p>This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text.</p> <p>This is the second paragraph. This is the second paragraph. This is the second paragraph. This is the second paragraph.</p>
The result of the code (above) is displayed below :
This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text. This is the first paragraph of text.
This is the second paragraph. This is the second paragraph. This is the second paragraph. This is the second paragraph.
Related Posts:
Learn More about HTML p tag at w3schools.
WordPress, SEO, and Social Media Marketing
Using more than one CSS property
What is a Shortcode in WordPress?
The background-color CSS property
Building a web page with HTML tags
CSS, HTML, JAVASCRIPT, Online Compiler. Code on the go by replit.it
Build to-do list web-app with code
How to make a Go-Back Input button with inline JavaScript
Introduction to JavaScript – Control Flow: True and False values
Learn RE – Regular Expressions in Python
Introduction to JavaScript – Variables: String Interpolation II
Introduction to JavaScript – Built-in Methods
Introduction to JavaScript – Variables: String Interpolation
CODING WITH CSS: The style attribute
Introduction to JavaScript – Variables: Review
Introduction to JavaScript – Control Flow
Introduction to JavaScript – Create a Variable: const
Introduction to JavaScript – Data Types
Introduction to JavaScript – Variables
Introduction to JavaScript – Variables: String Interpolation