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 Selectors Selectors - Beyond the Basics Child, Adjacent, and General Sibling Combinators

.btn

4:18 min Guill says " let's create a new selector that targets the class button". On Css he writes '.btn', but on html the classes are written "btn default inln and btn error inln". Why on css he wrote .btn and not .btn default inln? Shouldn't he write "btn default inln and btn error inln"?

1 Answer

In this challenge, the point is to learn to use multiple classes to style your elements.

The btn class styles an element to look like a button.

default and error make the button-styled elements have different background colors.

I'm assuming that the inln style makes an element inline-block (but can be used on other elements besides btn-styled ones).

Think of btn as a new car of a specific model, say a Jeep Compass.

default and error are like the different paint job options, such as white, black or metallic silver, which apply to any/all models.

inlin is like a sunroof option, which you can get on a Compass, Cherokee or Wrangler model.

So an element of class="btn default inlin" is like a white Jeep Compass with a sunroof.

Does that make sense?

I hope that helps.

Stay safe and happy coding!