HTML Paragraphs


A paragraph usually starts on a new line and contains a block of text.


HTML Paragraphs

The HTML <p> element defines a paragraph.

In HTML, a paragraph always begins on a new line, and browsers automatically apply some white space (margin) before and after each paragraph.


HTML Display

HTML content may produce varied outcomes on large or small screens and when windows are resized.

When working with HTML, adding extra spaces or lines in your code does not alter the way the content is displayed.

When the page is displayed, the browser automatically removes any additional spaces and lines.


HTML Horizontal Rules

The <hr> tag creates a visual separation, usually in the form of a horizontal rule, to divide content or indicate a change in an HTML page..

The <hr> tag is a self-closing or empty tag in HTML, which means it does not require an end tag.


HTML Line Breaks

The HTML <br> tag is used to define a line break, which means it creates a new line within the content where it is placed. It is also a self-closing or empty tag and does not require an end tag. it is usually used when we want to start a new paragraph.


The Poem Problem

This poem will appear in a single line.


Solution - The HTML <pre> Element

The HTML <pre> tag is used to represent preformatted text.

When content is placed within a <pre>, it appears with a fixed-width font (commonly Courier), and it retains both spaces and line breaks <br> as they are written in the HTML code: