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 trialSteven Prescott
19,206 PointsAdvanced 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
Courses Plus Student 55,489 Pointsyou 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;
}
}
Steven Prescott
19,206 PointsI would've never figured that out. Thanks!
James Barnett
39,199 PointsIndenting, syntax highlighting and syntax checkers are your friend.
Maximiliane Quel
Courses Plus Student 55,489 Pointsno worries :0)