Why should $x be less than 11?

this is “Sass: Apply a Style Until a Condition is Met with @while”. I don’t understand why there is less than 11 for the $x as counter. why not another number?

Your code so far


<style type='text/scss'>
$x : 1;
@while $x < 11 {
.text-#{$x} { font-size: 15px * $x}
$x: $x + 1;
}


</style>

<p class="text-1">Hello</p>
<p class="text-2">Hello</p>
<p class="text-3">Hello</p>
<p class="text-4">Hello</p>
<p class="text-5">Hello</p>

Your browser information:

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

Challenge: Apply a Style Until a Condition is Met with @while

Link to the challenge:

It doesn’t ask you anywhere to make it less than 11, it asks you for another number.

So I can change it to any number I want? @DanCouper

No, you need to follow the instructions, which specify a number you need to use.

1 Like