/
When you write a letter or story on paper, you naturally separate your thoughts into paragraphs and sometimes break lines for emphasis. HTML works the same way - it gives you tools to organize your text and control how it appears on the screen.
The paragraph tag <p> is probably the most used HTML element. It's like the basic building block for any text content on your website. Every time you want to write a block of text, you wrap it in paragraph tags.
<p>This is a simple paragraph. It contains one complete thought or idea.</p>
<p>This is another paragraph. Notice how it automatically adds space above and below.</p>When displayed in a browser, these paragraphs will have space between them, making your content easy to read.
One of the best things about HTML paragraphs is that they automatically add space around themselves. You don't need to worry about spacing - the browser handles it for you.
<p>First paragraph of text.</p>
<p>Second paragraph of text.</p>
<p>Third paragraph of text.</p>Result: Each paragraph will be separated by white space, creating a clean, readable layout.
Here's something that surprises many beginners - HTML ignores extra spaces and line breaks in your code:
<p>This paragraph has lots of extra spaces
and line breaks in the code,
but they won't show up
in the browser.</p>What you see: "This paragraph has lots of extra spaces and line breaks in the code, but they won't show up in the browser."
The browser treats all that extra spacing as just one single space.
Sometimes you need to break a line without starting a new paragraph. That's where the line break tag <br> comes in handy.
<p>First line of text<br>
Second line of text<br>
Third line of text</p>Important: The <br> tag is self-closing, meaning it doesn't need a closing tag like </br>.
Line breaks are perfect for:
Addresses:
<p>John Smith<br>
123 Main Street<br>
New York, NY 10001</p>Poetry or Song Lyrics:
<p>Twinkle, twinkle, little star<br>
How I wonder what you are<br>
Up above the world so high<br>
Like a diamond in the sky</p>Short Lists Without Bullets:
<p>Contact Information:<br>
Phone: (555) 123-4567<br>
Email: contact@example.com<br>
Website: www.example.com</p><p>Welcome to our bakery! We've been serving fresh bread and pastries for over 20 years.</p>
<p>Our specialty is handmade croissants using traditional French techniques passed down through generations.</p>
<p>Visit us today and taste the difference that quality ingredients make!</p><p>Store Hours:<br>
Monday - Friday: 6:00 AM - 8:00 PM<br>
Saturday: 7:00 AM - 9:00 PM<br>
Sunday: 8:00 AM - 6:00 PM</p><h1>My First Day at School</h1>
<p>Today was my first day at the new school, and I was really nervous. I woke up early and couldn't eat breakfast because of butterflies in my stomach.</p>
<p>When I walked into the classroom, everyone looked at me. The teacher, Mrs. Johnson, was very kind and introduced me to the class.</p>
<p>By lunchtime, I had already made two new friends: Sarah and Mike. We sat together in the cafeteria and talked about our favorite movies.</p>
<p>I'm excited to go back tomorrow and continue making new friends!</p><h2>Contact Us</h2>
<p>We'd love to hear from you! Reach out using any of the methods below:</p>
<p>Mailing Address:<br>
ABC Company<br>
456 Business Ave<br>
Suite 100<br>
Los Angeles, CA 90210</p>
<p>Phone & Email:<br>
Phone: (555) 987-6543<br>
Fax: (555) 987-6544<br>
Email: info@abccompany.com</p><h2>Chocolate Chip Cookie Recipe</h2>
<p>These cookies are perfect for any occasion and take just 30 minutes to make from start to finish.</p>
<p>Ingredients you'll need: flour, sugar, butter, eggs, vanilla extract, baking soda, salt, and chocolate chips.</p>
<p>Baking Instructions:<br>
Preheat oven to 375°F<br>
Mix dry ingredients in large bowl<br>
Add wet ingredients and stir<br>
Fold in chocolate chips<br>
Bake for 10-12 minutes</p>
<p>Let cookies cool on the baking sheet for 5 minutes before transferring to a wire rack. Enjoy with a glass of cold milk!</p><!-- ❌ WRONG - Using too many line breaks -->
<br><br>
This is some text<br><br>
This is more text<br><br>
And even more text<br><br>
<!-- ✅ CORRECT - Using proper paragraphs -->
<p>This is some text</p>
<p>This is more text</p>
<p>And even more text</p><!-- ❌ WRONG - Using empty paragraphs for spacing -->
<p>First paragraph</p>
<p></p>
<p></p>
<p>Second paragraph with extra space</p>
<!-- ✅ CORRECT - Use CSS for spacing instead -->
<p>First paragraph</p>
<p style="margin-top: 30px;">Second paragraph with extra space</p><!-- ❌ WRONG - Missing closing tags -->
<p>This paragraph never closes
<p>This creates messy HTML
<!-- ✅ CORRECT - Always close your tags -->
<p>This paragraph closes properly</p>
<p>And so does this one</p>Here's how different approaches look on your webpage:
<p>First block of content</p>
<p>Second block of content</p>
<p>Third block of content</p>Result: Three separate blocks with space between each
<p>First line<br>Second line<br>Third line</p>
Result: Three lines close together within one text block
<p>This is the first paragraph with regular spacing.</p>
<p>This paragraph has multiple lines:<br>
Line one<br>
Line two<br>
Line three</p>
<p>This is the final paragraph.</p>Result: Paragraphs have normal spacing, but lines within the second paragraph are close together
Each paragraph should contain one main idea. If you're talking about something new, start a new paragraph.
Resist the urge to use multiple <br> tags to create spacing. Use CSS instead for better control.
Break up long blocks of text into shorter paragraphs. People read differently on screens than on paper.
If you use line breaks for addresses in one place, use them the same way throughout your website.
| Element | Purpose | Example |
|---|---|---|
| <p> | Create paragraphs | <p>Your text here</p> |
| <br> | Single line break | Line one<br>Line two |
| Multiple <p> | Separate ideas | <p>Idea 1</p><p>Idea 2</p> |
| <br> in <p> | Lines within same idea | <p>Name<br>Address<br>Phone</p> |
Try creating a simple webpage about yourself using paragraphs and line breaks:
<!DOCTYPE html>
<html>
<head>
<title>About Me</title>
</head>
<body>
<h1>About Me</h1>
<p>Hi! My name is [Your Name] and I'm learning HTML. This is my practice webpage where I'm testing paragraphs and line breaks.</p>
<p>My contact information:<br>
Email: your.email@example.com<br>
Phone: (555) 123-4567<br>
City: Your City, State</p>
<p>I enjoy learning new things, especially web development. HTML is easier than I thought it would be!</p>
<p>My goals for this month:<br>
Learn basic HTML<br>
Start learning CSS<br>
Build my first website</p>
</body>
</html>
Now that you understand how to organize text with paragraphs and line breaks, you're ready to create readable, well-structured web content. These simple elements form the foundation of almost every webpage on the internet.
In our next lesson, we'll explore how to make your text stand out using bold, italic, and other text formatting options. You'll learn how to emphasize important words and make your content more engaging for readers.