#7 HTML Paragraphs

A paragraph always starts on a new line, and is usually a block of text.

<p> tag use to describe paragraph in web page. A paragraph always starts on a new line, and browsers automatically add some white space (a margin) before and after a paragraph.

See the Pen paragraph tag by Arpit (@soniarpit) on CodePen.

With HTML, you cannot change the display by adding extra spaces or extra lines in your HTML code.

The browser will automatically remove any extra spaces and lines when the page is displayed, you can see in the above example.

HTML Horizontal Rules

The <hr> tag defines a thematic break in an HTML page and is most often displayed as a horizontal rule.

The <hr> element is used to separate content (or define a change) in an HTML page. It adds a horizontal line.

See the Pen hr tag by Arpit (@soniarpit) on CodePen.

The <hr> tag is an empty tag, which means that it has no end tag.

HTML Line Breaks

The HTML <br> element defines a line break. Use if you want a new line without starting a new paragraph.

See the Pen br tag by Arpit (@soniarpit) on CodePen.

The <br> tag is an empty tag, which means that it has no end tag.

The Poem Problem

<p> tag can’t display poem as poem style. See the following.

See the Pen the poem problem by Arpit (@soniarpit) on CodePen.

Solution - The HTML
 Tag

<pre> tag is used to preserve the white space and lines in the text.

See the Pen pre tag by Arpit (@soniarpit) on CodePen.

Hope you like this tutorial. Try this all by your self.

Previous: #6 HTML Headings

Next: #8 HTML Text Formatting