HTML Paragraphs are a block-level elements, used to structure and format text content on a webpage. A paragraph is basically a collection of words and punctuation together.
<!DOCTYPE html> <html> <head> <title>HTML Paragraphs</title> </head> <body> <!-- HTML p Tag used --> <p>This is real time online HTML Editor</p> </body> </html>
Properties of the paragraph tag: HTML Paragraphs
- As already mentioned, the<p>tag automatically adds space before and after any paragraph, which is basically margins added by the browser.
- If a user adds multiple spaces, the browser reduces them to a single space.
- If a user adds multiple lines, the browser reduces them to a single line.
- By default, the display of the Paragraph element is set to “block” which you can change using CSS. This means that if you add another paragraph to the webpage
Lists with Paragraphs : HTML Paragraphs
HTML <li> tag can be used where a list of element required after a desccription. Lists can be incorporated within paragraphs for content organization.
<html> <head> <title>Enhancing Paragraphs </title> </head> <body> <ul> <li>Item 1</li> <li>Item 2</li> </ul> <p> This is a paragraph following an unordered list. </p> </body> </html>
Tag | Description |
---|---|
<p> | Defines a paragraph |
<hr> | Defines a thematic change in the content |
<br> | Inserts a single line break |
<pre> | Defines pre-formatted text |