i have a problem with Sass: Use @for to Create a Sass Loop
the question:
Write a @for directive that takes a variable $j that goes from 1 to 6.
It should create 5 classes called .text-1 to .text-5 where each has a font-size set to 10px multiplied by the index.
My answer :(but it dosen’t work) @for $j from 1 to 6{
.text-#{$j}{font-size: 10px*$j ;}
}
Hi @safaBelhaj! Your code looks fine. Is your code in the right place? Remember, all styling has to be in CSS-type file or between <style> tags.
For future reference, please use the “Ask for Help” button in the FCC challenges, as it preformats everything and includes a link to the challenge! It will make helping you a ton easier
Let me know if this helps, or if you need more help!
Hi @safaBelhaj will you post your entire code? Be sure to copy and paste it into a code block following 3 backticks (```) and closing it with 3 more backticks.
Hi…your problem is in your for loop.
“The main difference is that “start to end” excludes the end number, and “start through end” includes the end number.”
Edit- 2 minutes after posting it passes. A lot of the SASS lessons I’m finding (and there’s been open bug logs on it) you have to mash the RUN TESTS buttons a bunch of times to get it to work correctly.
Here is some more info- further down in the thread someone listed which rebellious lessons causes problems.
// running tests
Your .text-1 class should have a font-size of 10px.
// tests completed
Seems weird that all the other tests pass. I even verified in Chrome Dev Tools that the applied sizing is 10px on the sample markup. Anyone know how to get this test to pass / report an issue to FCC? Thanks!