Use @each to Map Over Items in a List.....What is the problem here? I don't think my code be wrong stil showing wrong

Tell us what’s happening:

Your code so far

<style type='text/sass'>
  @each $color-bg in blue,black,red {
  background-color: blue;
  background-color: black;
  background-color: red;
  div {
    height: 200px;
    width: 200px;

<div class="blue-bg"></div>
<div class="black-bg"></div>
<div class="red-bg"></div>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:

Notice the example in the instructions:

@each $color in blue, red, green {
  .#{$color}-text {color: $color;}

Use that as a model.

try with this too but still seems wrong

Show us the exact code you used.

Here be the link.

No, that is the link to the exercise. It doesn’t contain your code, except on your browser. Please cut and past your code into your reply so we can see it. Then I can tell you what is wrong with it.

after this they seemed wrong.

Again, I asked you to cut and paste the code, not take a pic. But OK…

Get rid of lines 7-15. All the magic is going to happen on line 5.

Look at the example I gave you:

@each $color in blue, red, green {
  .#{$color}-text {color: $color;}

That’s basically what you need to do. But instead of $color for the variable name, you have $color-bg. That’s fine. You could have called it $elephant-pajamas it doesn’t matter as long as it’s consistent.

OK, but the way you have your variable used, your classes will be like .blue-background-color. But according to the instructions you need .blue-bg.

Write an @each directive that goes through a list: blue, black, red and assigns each variable to a .color-bg class, where the “color” part changes for each item.

So, you need to fix .#{$color-bg}-background-color in your code. Remember that #{$color-bg} is just the variable name and will be replaced with blue, black, red. The {background-color: $color-bg;} part looks correct. I think you just need to fix the class names that are being created.