HTML COURSE โ€ข LESSON 7

HTML Paragraphs

Paragraphs are used to display blocks of text on a web page.

The HTML Paragraph Element

The <p> element creates a paragraph.

Paragraph Example
<p>
    EDUHUB is an online learning platform.
</p>

<p>
    Students can learn coding and study lessons.
</p>

HTML Display Rules

Browsers automatically remove extra spaces and extra lines from HTML code.

Extra Spaces
<p>
This paragraph
contains many spaces
and lines.
</p>

The browser normally displays this as one paragraph with normal spacing.

HTML Horizontal Rules

The <hr> element creates a horizontal line.

Horizontal Line
<h1>HTML Course</h1>

<p>Learn HTML with EDUHUB.</p>

<hr>

<h2>Next Lesson</h2>

HTML Line Breaks

The <br> element creates a line break.

Line Break
<p>
EDUHUB<br>
Code Hub<br>
HTML Course
</p>

The pre Element

The <pre> element preserves spaces and line breaks.

Preformatted Text
<pre>
EDUHUB

    Learn HTML

        Build Websites
</pre>

โšก EDUHUB Live HTML Editor

LIVE PREVIEW