Concatenating 'Good' + 'Morning' results in 'GoodMorning' without space.
Step 2: Identify missing space issue
To get 'Good Morning', a space string ' ' must be added between variables.
Final Answer:
Missing space between words in concatenation -> Option B
Quick Check:
Concatenation needs spaces explicitly [OK]
Hint: Add ' ' string to insert spaces when joining words [OK]
Common Mistakes:
Assuming + adds spaces automatically
Not adding space string between variables
Confusing syntax errors with logic errors
5. You want to create a dynamic CSS class name by joining 'btn-' with a variable $color that can be 'red' or 'blue'. Which Sass code correctly creates the class name .btn-red or .btn-blue?
hard
A. .btn-{$color} { color: $color; }
B. .btn-" + $color + " { color: $color; }
C. .btn-#{$color} { color: $color; }
D. .btn-" #{$color} " { color: $color; }
Solution
Step 1: Understand string interpolation in selectors
Sass uses #{} to insert variable values inside strings or selectors.
Step 2: Check each option's syntax
.btn-#{$color} { color: $color; } uses .btn-#{$color} which correctly joins 'btn-' and variable. .btn-" + $color + " { color: $color; } uses + which is invalid in selectors. .btn-{$color} { color: $color; } misses #{} so variable won't be replaced. .btn-" #{$color} " { color: $color; } has invalid quotes placement.
Final Answer:
.btn-#{$color} { color: $color; } -> Option C
Quick Check:
Use #{} for variable interpolation in selectors [OK]
Hint: Use #{} to insert variables inside strings/selectors [OK]
Common Mistakes:
Trying to use + for selector concatenation
Forgetting #{} for interpolation
Incorrect quote placement around variables
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.