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

Advanced Sass Concepts Creating Loops Challenge

I can't figure out what I'm doing wrong here. It's Advanced Sass Concepts and I'm on the code challenge for "Creating Loops with @for and @each." Here's the link to the code challenge: http://teamtreehouse.com/library/sass-basics/advanced-sass-concepts/creating-loops-with-for-and-each-2. It's challenge one of two. Here's the code I have so far and thanks in advance.

/* Write your SCSS code below. */
@for $i from 1 through 3 {
.item-#{$i} {width: $i * 100px;};
}

3 Answers

Maximiliane Quel
PLUS
Maximiliane Quel
Courses Plus Student 55,489 Points

you have a semi-colon after your curly braces surrounding the width property. also I'm not sure but it looks like you have a - instead of _ in your class name. without it should work:

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

I would've never figured that out. Thanks!

James Barnett
James Barnett
39,199 Points

Indenting, syntax highlighting and syntax checkers are your friend.