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
The <p> tag defines a paragraph of text.
Browsers automatically add margin (white space) before and after each paragraph.
Paragraphs are block-level elements—they always start on a new line.
Extra spaces or new lines inside the code are ignored by the browser.
You cannot nest a block-level element (like a div) inside a paragraph.
The <br> tag can be used to create a line break within a paragraph.
Professional Insights
Whitespace Collapse
The <br> tag Best Practices
Readability and SEO
Alignment and Styling
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.