HTML Paragraphs

HTML Paragraphs

A paragraph is a block of text that always starts on a new line.

The HTML <p> element defines a paragraph.

A paragraph always starts on a new line, and browsers automatically add some white space (called a margin) before and after it.

<p>Your first  paragraph.</p>
<p>Your another paragraph.</p>

HTML Display

You can’t know for sure how HTML will look.

Different things will happen if you change the size of your screen or window.

You can’t change the way something looks in HTML by adding extra spaces or lines.

When the page is shown, the browser will automatically get rid of any extra spaces and lines:

<p>

This paragraph’s

source code has

a lot of lines,

but the browser doesn’t

care about them.
</p>

<p>This paragraph’s

source code has

a lot of spaces between

the words, but

the browser doesn’t care.
</p>

HTML Horizontal Rules

The <hr> tag creates a break in the theme of an HTML page. It is usually shown as a horizontal line.

The <hr> element is used to break up content on an HTML page or mark a change:

<h1>Your heading 1</h1>

<p>Your some text.</p>

<hr>

<h2>Your heading 2</h2>

<p>Your other text.</p>

<hr>

The <hr> tag is empty, which means that it doesn’t have an end tag.

HTML Line Breaks

A line break is what the HTML <br> element does.

If you want a line break (a new line) but don’t want to start a new paragraph, use <br>:

<p>Your<br> paragraph<br>with line breaks.</p>

 

The HTML tag <pre> Element

The HTML pre> element defines text that has already been set up.

Text inside a pre> element is shown in a fixed-width font (usually Courier), and spaces and line breaks are kept:

<pre>
Clouds lies over the sky.

Clouds lies over the sea.

Clouds lies over the sky.

Oh, bring rainbow here.
</pre>

Reference to HTML Tags

The reference for the coderazaa tag has more information about HTML elements and their attributes.

 <p>

explains what a paragraph is

<hr>

Describes a change in the main idea of the content.

<br>

Adds just one line break.

<pre>

Describes text that has already been formatted.

People also search
Scroll to Top