Paragraph
What is a Paragraph in HTML?
A paragraph in HTML is used to define blocks of text, typically representing one or more sentences. The <p> is the paragraph tag used to add such text within your web pages. It helps organize content and improve readability.
Syntax:
Deprecated Attribute
The align attribute in HTML was historically used to set the alignment of various elements, such as paragraphs (<p>), images and tables to the left, center or right. However, the use of the align attribute for styling has been deprecated in favor of CSS, which provides more control and flexibility.
HTML once allowed alignment using the align attributes, like
However, this is now deprecated. The recommended way is to use CSS
Example: Basic Paragraph Tag
Output:

Using <hr> Tag to Separate Paragraphs
The <hr> tag creates a horizontal line to visually separate section or topics. It does not require a closing tag. This line helping to organize and clarify the structure of your content. It is a simple and effective way to indicate a shift in topic. In addition to its default appearance as a solid line, the <hr> tag can be customized with CSS to change it's thickness, color or style giving you control over how it fits within your design.
Example:
Output:

Using <br> Tag for Line Breaks
The <br> tag adds a line break within a paragraph without starting a new one. It's like pressing 'Enter' in a text editor. This tag is especially useful or you might use the <br> tag in an address, a poem or any place where you need to control the flow of text with precision.
Example:
Output:

Using <pre> Tag for Preserved Text Formatting
The <pre> tag in HMTL is used to maintain the exact formatting of text, including spaces, tabs and line breaks. Unlike other HTML elements, which might compress multiple spaces into a single space or ignore line beaks, the <pre> tag preserves all the whitespace exactly as it appears in the code. This makes it particularly useful for displaying code snippets, poetry or any text where the layout and indentation are important.
Example:
Output:

A paragraph in HTML is used to define blocks of text, typically representing one or more sentences. The <p> is the paragraph tag used to add such text within your web pages. It helps organize content and improve readability.
- The <p> tag is used to define a paragraph of text in HTML.
- It is a container tag which means it has both opening <p> and closing </p> tags.
Syntax:
<p>Your content here</p>
Deprecated Attribute
The align attribute in HTML was historically used to set the alignment of various elements, such as paragraphs (<p>), images and tables to the left, center or right. However, the use of the align attribute for styling has been deprecated in favor of CSS, which provides more control and flexibility.
HTML once allowed alignment using the align attributes, like
<p align="center">This paragraph is centered.</p>
However, this is now deprecated. The recommended way is to use CSS
<p style="text-align: center;">This paragraph is centered.</p>
Example: Basic Paragraph Tag
<!DOCTYPE html> <html> <body> <h2>Welcome To Quipo House</h2> <!-- Use of <p> tag --> <p>This is a paragraph.</p> </body> </html>
Output:

Using <hr> Tag to Separate Paragraphs
The <hr> tag creates a horizontal line to visually separate section or topics. It does not require a closing tag. This line helping to organize and clarify the structure of your content. It is a simple and effective way to indicate a shift in topic. In addition to its default appearance as a solid line, the <hr> tag can be customized with CSS to change it's thickness, color or style giving you control over how it fits within your design.
Example:
<!DOCTYPE html> <html> <body> <h1>Example of <hr> tag </h1> <h4>This is a heading</h4> <p>This is a paragraph.</p> <hr> <h4>This is another heading</h4> <p>This is another paragraph.</p> <hr> </body> </html>
Output:

Using <br> Tag for Line Breaks
The <br> tag adds a line break within a paragraph without starting a new one. It's like pressing 'Enter' in a text editor. This tag is especially useful or you might use the <br> tag in an address, a poem or any place where you need to control the flow of text with precision.
Example:
<!DOCTYPE html> <html> <body> <h1>Example of <br> tag </h1> <p>This is a paragraph<br>with a line break</p> </body> </html>
Output:

Using <pre> Tag for Preserved Text Formatting
The <pre> tag in HMTL is used to maintain the exact formatting of text, including spaces, tabs and line breaks. Unlike other HTML elements, which might compress multiple spaces into a single space or ignore line beaks, the <pre> tag preserves all the whitespace exactly as it appears in the code. This makes it particularly useful for displaying code snippets, poetry or any text where the layout and indentation are important.
Example:
<!DOCTYPE html> <html> <body> <h1>Example of <pre> tag in writing poems</h1> <pre> Twinkle Twinkle little star, How i wonder what your are! Up above the world so high, Like a diamond in the sky. </pre> </body> </html>
Output:
