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

@for and @each Loop Code challenge

I get stuck in this .... I think I am righting correctlly but still I thing somethin is missing but I don't know how to fix it any Idea??

@for $i from 1 through 3 {
  .item_#{$i} { width: 100px * $i;}
}

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

2 Answers

Mårten Björk:

Thank for that i really change that but didn't work hower I recheck the video and I wasn't so far frome the answer and your recomendation help me to do it Thanks!!

Happy to help out :) Good luck!

Hi! On the last line, you don't need to wrap $color in curly braces. Just

background: $color;

will do. Just tested the code on my computer and it works great!