0
0
SASSmarkup~20 mins

SASS vs SCSS syntax difference - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
SASS vs SCSS Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
Identify the correct SCSS syntax for nesting
Which option shows the correct SCSS syntax to nest a p tag inside a div with a color of blue?
A
div {
  p {
    color: blue;
  }
}
B
div
  p
    color: blue
C
div {
  p: {
    color: blue;
  }
}
D
div
  p {
    color: blue
  }
Attempts:
2 left
💡 Hint
Remember SCSS uses braces and semicolons like CSS.
📝 Syntax
intermediate
2:00remaining
Identify the correct SASS syntax for variables
Which option shows the correct SASS syntax to define a variable $main-color with value #333 and use it for text color?
A
$main-color: #333;

body {
  color: $main-color;
}
B
$main-color: #333

body
  color: $main-color
C
$main-color = #333

body
  color: $main-color
D
$main-color: #333

body {
  color: $main-color
}
Attempts:
2 left
💡 Hint
SASS uses indentation and no semicolons or braces.
rendering
advanced
2:00remaining
What color will the paragraph text be?
Given the following SCSS code, what color will the paragraph text inside section be when rendered in the browser?
SASS
section {
  color: red;
  p {
    color: green;
  }
}
AGreen
BRed
CBlack (default)
DBlue
Attempts:
2 left
💡 Hint
Nested selectors override parent styles for the same property.
selector
advanced
2:00remaining
Which SASS syntax correctly nests a hover state?
Which option shows the correct SASS syntax to style a button with a blue background and change background to dark blue on hover?
A
button
  background: blue
  &:hover {
    background: darkblue
  }
B
button {
  background: blue;
  &:hover {
    background: darkblue;
  }
}
C
button
  background: blue
  &:hover
    background: darkblue
D
button {
  background: blue
  &:hover
    background: darkblue
}
Attempts:
2 left
💡 Hint
SASS uses indentation and no braces or semicolons.
accessibility
expert
3:00remaining
Which SCSS snippet improves accessibility by using focus styles?
Which SCSS code snippet correctly adds a visible focus outline to links for keyboard users?
A
a {
  color: blue;
  &:active {
    outline: none;
  }
}
B
a {
  color: blue;
  &:hover {
    outline: 3px solid orange;
  }
}
C
a {
  color: blue;
  &:visited {
    outline: 3px solid orange;
  }
}
D
a {
  color: blue;
  &:focus {
    outline: 3px solid orange;
    outline-offset: 2px;
  }
}
Attempts:
2 left
💡 Hint
Focus styles help keyboard users see which element is active.