Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Basics Images, Text and Links Creating Breaks in Content

Melanie Brown
Melanie Brown
814 Points

<br> vs. <p>

Is there a difference in using <br> and <p>, for instance in the example from the video, on an address? Thanks in advance!

Melanie Brown
Melanie Brown
814 Points

Nevermind! I did it and learned the difference.

<p> puts space between the lines of text whereas <br> makes it a block of text.

2 Answers

Steven Parker
Steven Parker
229,644 Points

I think you may have that backwards, <br> gives you a new line and <p> puts the contents in a block (with margins).

Also, <br> is an empty element with only a start tag, but <p> encloses content with both a start and end ("</p>") tag.

For more details, see the MDN pages for <br> and <p>.

Melanie Brown
Melanie Brown
814 Points

Thanks Steven, I see what you mean! In this case, though, I was referring to the address example, specifically, from this video.