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 trialammarkhan
Front End Web Development Techdegree Student 21,661 Pointsunable to pass the challenge
I am unable to pass the last stage of the challenge as it says "Undefined variable $target"
div {
background-color: green;
}
$cols : 10;
$width : 50px;
$gutter : 15px;
$context : ($width * $cols) + ($gutter * ($cols - 1));
@for $i from 1 through $cols{
.grid__col--#{$i}{
width: percentage($target/$context);
$target : ($width * $i) + ($gutter * ($i - 1));
}
}
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! You're actually doing terrific, but it is correct. The $target is not defined. You've got the two correct lines, but they're in the incorrect order. Your first line calculates the width, but it needs the value of $target
to do so. And $target
isn't defined until the next line.
Simply switching the order of the two lines will cause this to pass! Well done!
ammarkhan
Front End Web Development Techdegree Student 21,661 Pointsammarkhan
Front End Web Development Techdegree Student 21,661 PointsTBH, Grid is the hardest to understand, forget applying it I tried 3 times to study but nada Jennifer Nordell