HTML Paragraphs
What are HTML Paragraphs?
The HTML <p> element defines a paragraph. A paragraph always starts on a new line, and browsers automatically add some white space (a margin) before and after a paragraph.
Basic Paragraph
Example
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
Line Breaks
Use the <br> tag to insert a line break without starting a new paragraph:
Example
<p>This is a line.<br>This is a new line.</p>
Text Formatting
You can format text within paragraphs using various HTML elements:
Example
<p>This is <strong>bold</strong> text.</p>
<p>This is <em>italic</em> text.</p>
<p>This is <mark>highlighted</mark> text.</p>
<p>This is <small>small</small> text.</p>
<p>This is <del>deleted</del> text.</p>
<p>This is <ins>inserted</ins> text.</p>
<p>This is <sub>subscript</sub> and <sup>superscript</sup> text.</p>
Preformatted Text
The <pre> element preserves both spaces and line breaks:
Example
<pre>
This text
preserves spaces
and line breaks.
</pre>
Horizontal Rule
The <hr> tag creates a horizontal line to separate content:
Example
<p>First section</p>
<hr>
<p>Second section</p>