Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS Modular CSS with Sass Sass and BEM BEM Challenge

Modular CSS with Sass Challenge

Not sure what is wrong...

style.scss
.menu {
  margin: 1em 0;

}
.menu__link {
      color: blue;
      padding: .5em;
   }

This is the challenge- Use a parent selector reference to output the BEM class .menu__link. Set the color to blue and the padding to .5em.

2 Answers

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Hillionaire,

First you need to write your code inside the existing code as your going to use the parent selector which is &
As the code already targets .menu and you need to target .menu__link you only need your code to target __link as the parent selector replaces .menu like so &__link (.menu is the parent)

.menu {
  margin: 1em 0;
  &__link {
      color: blue;
      padding: .5em;
   }
  }

I hope I've explained it clearly enough, if not just ask.

Hope this helps.

.menu { margin: 1em 0; &_link { color: blue; padding: .5em; } } This is also not correct. Any tips?

Wayne Priestley
Wayne Priestley
19,579 Points

Hi Hillionaire,

Looks like you used a single underscore, try using a double underscore between &__link

Wow! Thanks!

Hi,

You're not supposed to repeat the "menu" part of the class name, you have to use the parent selector (&) so, within the .menu{} part of the code you have to add the parent selector and the rest of the code. (I'm trying not to give you the answer so you can figure it out). Remember this is modular and part of it is making the code more compressed.