HTML Basics
HTML Paragraphs
The paragraph is the workhorse of text on the web. This page shows the p tag, line breaks, horizontal rules, and how browsers treat spaces.
The Paragraph Tag
The p element defines a paragraph of text. Browsers automatically add space above and below each paragraph.
<p>This is the first paragraph.</p>
<p>This is the second paragraph.</p>How Browsers Handle Whitespace
HTML collapses multiple spaces and line breaks into a single space. So writing your text on several lines or adding many spaces will not change how it appears.
<p>Hello world
and beyond.</p>Line Breaks and Horizontal Rules
Use <br> to force a line break within text, and <hr> to draw a thematic horizontal line between sections. Both are empty elements.
<p>Line one<br>Line two</p>
<hr>
<p>A new section starts here.</p>If you need to preserve exact spaces and line breaks, wrap your text in a <pre> element. It displays text exactly as typed, in a monospaced font.
