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 trialhillionaire
22,539 PointsModular CSS with Sass Challenge
Not sure what is wrong...
.menu {
margin: 1em 0;
}
.menu__link {
color: blue;
padding: .5em;
}
2 Answers
Wayne Priestley
19,579 PointsHi 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.
hillionaire
22,539 Points.menu { margin: 1em 0; &_link { color: blue; padding: .5em; } } This is also not correct. Any tips?
Wayne Priestley
19,579 PointsHi Hillionaire,
Looks like you used a single underscore, try using a double underscore between &__link
hillionaire
22,539 PointsWow! Thanks!
Mireille Pasos
35,469 PointsHi,
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.
hillionaire
22,539 Pointshillionaire
22,539 PointsThis 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.