HTML paragraphs group text into distinct blocks. Browsers automatically display paragraphs on a new line with vertical spacing above and below.
<p>)You create a paragraph using the <p> opening tag and </p> closing tag.
<p>This is a paragraph of text on a web page.</p>
<p>This is a second paragraph separated by automatic browser margins.</p>
HTML automatically collapses multiple consecutive spaces or newline breaks into a single space when rendering in the browser window.
If you need a line break inside a paragraph without starting a new block, use the <br> tag. To insert a thematic break divider line, use the <hr> tag.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML Paragraphs and Breaks Example</title>
</head>
<body>
<h2>Contact Information</h2>
<!-- Standard Paragraph -->
<p>We welcome feedback and questions from global learners building web projects.</p>
<!-- Horizontal Rule Divider -->
<hr>
<!-- Paragraph using Line Breaks for Address Formatting -->
<p>
KoderSolution Headquarters<br>
123 Tech Avenue, Suite 400<br>
San Francisco, CA 94107
</p>
<!-- Paragraph containing emphasis -->
<p>Our support team responds within 24 business hours.</p>
</body>
</html>
<br> tags to add vertical spacing: Avoid stacking multiple <br><br> tags to push content down. Set layout spacing using CSS margin-bottom or gap properties instead.<p>: Paragraph tags can contain inline elements (<a>, <strong>, <em>), but putting block elements (<div>, <ul>, <h1>) inside <p> is invalid HTML markup.<body> or <div> elements. Wrapping text in <p> ensures screen readers and CSS styles target text blocks accurately.Create two paragraphs describing your favorite programming language. Add a <hr> line between them, and use a <br> tag inside the second paragraph to split a sentence onto a new line!
Sign in to track your learning journey, earn industry-recognized certificates, and join our elite developer community.
Quick Access With
Experiment with the code from this lesson in our interactive playground.