HTML Paragraphs
Learn how to structure text on web pages using the <p> tag for clear readability.
What is a Paragraph?
Paragraphs in HTML are blocks of text wrapped in the <p> tag. They help organize content for better readability and structure on a web page.
Real-Life Example: Just like in a book or article, paragraphs separate ideas and make reading easier.
Basic Paragraph Usage
Example: Basic Paragraphs
<p>This is the first paragraph of text.</p>
<p>This is the second paragraph, separated from the first by space.</p>
Formatting Text Inside Paragraphs
You can format text inside paragraphs using other inline HTML tags:
<strong>– Bold text<em>– Italic text<a>– Hyperlinks<span>– Custom styling with CSS
Example: Formatted Paragraph
<p>This is a <strong>bold</strong> word and this is <em>italic</em>.</p>
<p>Visit <a href="https://crackease.com">CrackEase</a> for tutorials.</p>
Multiple Lines and Spacing
Paragraphs automatically create space above and below text. For line breaks inside a paragraph, use the <br> tag.
Example: Line Breaks
<p>This is the first line.<br>
This is the second line inside the same paragraph.</p>
Best Practices for Paragraphs
- Use one idea per paragraph for clarity
- Avoid using multiple
<br>tags instead of paragraphs - Keep paragraphs short for better readability
- Use semantic HTML tags (
<p>) instead of just<div>for text - Combine with headings for structured content
Pro Tip: Well-structured paragraphs improve user experience and make your content easy to scan and read.