HTML Guide
CourseHTML Paragraphs
Core Concept
100% Comprehensive

HTML Paragraphs.

Paragraphs are used to group and structure blocks of text. They are the most common way to display text content on the web.

The Essentials

01

The <p> tag defines a paragraph of text.

02

Browsers automatically add margin (white space) before and after each paragraph.

03

Paragraphs are block-level elements—they always start on a new line.

04

Extra spaces or new lines inside the code are ignored by the browser.

05

You cannot nest a block-level element (like a div) inside a paragraph.

06

The <br> tag can be used to create a line break within a paragraph.

Professional Insights

Whitespace Collapse

HTML ignores multiple spaces or line breaks inside your code. If you need specific spacing, you must use CSS (margins/padding) or the <pre> tag.

The <br> tag Best Practices

Use <br> only for line breaks that are part of the content (like an address or a poem). Never use <br> to create space between paragraphs—use CSS instead.

Readability and SEO

Keeping paragraphs short (3-4 sentences) improves readability on mobile devices and keeps users engaged with your content longer.

Alignment and Styling

By default, text is left-aligned. You can use CSS (text-align: center/justify) to change the look of your paragraphs globally.

Critical Pitfalls

Using multiple <br> tags to create space between sections (use CSS margins instead).

Forgetting to close the <p> tag, which can lead to nested paragraph bugs.

Thinking that hitting 'Enter' in your code editor will create a new line on the webpage.

Nesting another <p> tag inside a <p>—this is invalid HTML.

Interactive Lab

Sprint Tasks

01
Create two separate paragraphs
02
Add a line break <br> inside the second paragraph between 'First' and 'Second'
Loading editor...
Production Preview