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

<element> or <element />

Hi

In the HTML course all void elements were without the self-closing tag (the forward slash). However, in some CSS videos I noticed the self-closing tags! So which one should I use now?

5 Answers

The second one, there is no need for the slash.

sorry i can't post inline code. please look at the link at post 2.

http://stackoverflow.com/questions/3558119/are-self-closing-tags-valid-in-html5

Still don't know which one should I choose

this:

<img src="image.jpg" alt="" />

or this

<img src="image.jpg" alt="">

With the example that you have posted , let's say that you were using the 'span' element. The opening would look like <span>, the closing would be </span>.

Giving you <span></span>. As opening and closing tags for the ''span" element.

Peaches Newbold - The code for your span tags didn't show up. Check out this thread on how to post code in the forum

Thanks James i'll check it out.