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

CSS CSS Layout CSS Layout Techniques Relative and Absolute Positioning

Justyn Phearson
Justyn Phearson
2,886 Points

why is figure and aside separated by a comma, but aside and img are not?

Aren't the figure and the img elements both descendants of the aside element?

figure, aside img, #bio { width: 100%; max-width: 600px; }

1 Answer

Steven Parker
Steven Parker
231,275 Points

The commas separate different selectors that this rule applies to.

The two terms aside and img form a descendant selector, where the first term identifies a containing element and the second one identifies the actual target. So in this case the target is any img element that is inside an aside. For more details, see this MDN page.

Justyn Phearson
Justyn Phearson
2,886 Points

Thank you very much. I was searching for the MDN page on this subject, but just kept calling them selectors. Now I know they are descendant selectors. Thank you very much for this source.