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 One Solution

Samuel Shackelford
Samuel Shackelford
1,213 Points

<span> - nested elements inside inline elements?

In the Hedgehog video around 4:10, Guil mentions in passing that using <footer> instead of <span> - because it's a block-level element - will ensure that there will be no problems with nested elements.

Am I correct in inferring that you cannot nest elements inside of inline elements?

e.g. <span>I like using <strong>bold</strong></span>

Thanks!

(https://teamtreehouse.com/library/one-solution-18)

1 Answer

Jamie Reardon
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jamie Reardon
Treehouse Project Reviewer

div (division) elements are considered generic containers that are commonly used along with span elements in the same manner. The difference between the two are that div elements are block-level scoped, and span elements are inline scoped. Having said that, you can therefore nest elements inside of a span element. They will be grouped under an inline (by default) element, but you may also override this default display setting to suit your needs. However, you should consider other best-method approaches for marking up your content with the newer HTML5 semantic markup tags.

Here is a resource on semantic elements