Skip to main content

Paragraphs, Breaks & Comments

What is a paragraph?

Paragraphs are the basic unit of text in HTML. The markup for a paragraph, <p> </p> separates bodies of text. By default, browsers separate paragraphs with a single blank line.

Consider the body of text below which is separated into paragraphs.

Try This

Remove the paragraph tags from the body of text below and see the resulting text display. Add paragraph tags at different places in the text and check the results.

Modify the code below and see the live browser output:

Paragraph tag tip

Paragraph tags create separation which can be used to separate more that just text.

Linebreaks

To start a new line without extra vertical space, you can use linebreak tag - <br>

Horizontal Rule

<hr> element is used to create a break between sections or elements. The <hr> tag renders as a horizontal line across the width of the page by default.

Comments

HTML documents can contain comments for information that is not for display. Comments in an HTML document begin with <!-- and end with -->.

Modify the code below and see the live browser output:

Singleton Tags

Both the linebreak <br> and the <hr> tags are singleton tags. Singleton tags have no closing tag.