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

Took a side trip down to Sass Basics...Use an @each loop to set the variable $color to the color red, then blue...

Use an @each loop to set the variable $color to the color red, then blue, and finally green. Use the loop to create three classes: .red_box, .blue_box, and .green_box. The background color for each class should be set to the corresponding color.

/*this is as far as I got
yes I'm totally lost
I'm going back to Sass w/Guill after this*/

@each $color in red, blue, green {
         .something      .#{$something}
    background: $color;
}

/*this is the example the video gave
I can't quite seem to translate it over to this question*/

@each $member in thom, jonny, colin, phil {
  .bandmember .#{$member}{
    background: url("images/#{$member}.jpg");
  }
}
Jason Anders
Jason Anders
Treehouse Moderator 145,860 Points

Hey John,

It would greatly help others help troubleshoot if you could provide a link to the challenge. :)

1 Answer

Hi John,

You're on the right track but your class selector needs to be more like what it was for task 1 of this challenge.

The selector from task1 was:

.item_#{$i}

In task 2 it wants the color followed by _box.

That should be

.#{$color}_box

Let me know if you're still stuck.