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

<br /> or <br> ?

I saw many articles online that prefer <br /> more than <br> tag. However, here in trehouse videos I saw them use <br>. The same for the <img ...>

So, which one is the 'best practice'?

2 Answers

The answer on this post explains it. For most modern applications the

<br> 

will do just fine

In HTML, you don't need to include the " />" on self-closing tags. That was only something you had to do in XHTML. In HTML 5, you don't even have to close most tags at all, although it feels weird not to, so I'd still close them, but don't worry about the self-closing tags if you're using the HTML doctype (ie. <br>, <hr>, <meta name="description" content="Your site description">, etc...).