0
0
SASSmarkup~10 mins

Number types and units in SASS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the width to 100 pixels.

SASS
$width: 100[1];
Drag options to blanks, or click blank then click option'
Apx
Bem
C%
Drem
Attempts:
3 left
💡 Hint
Common Mistakes
Using % instead of px for fixed pixel width.
Forgetting to add any unit after the number.
2fill in blank
medium

Complete the code to set the font size to 1.5 times the root element's font size.

SASS
font-size: 1.5[1];
Drag options to blanks, or click blank then click option'
Apx
Bem
C%
Drem
Attempts:
3 left
💡 Hint
Common Mistakes
Using em instead of rem when root-relative size is needed.
Using px which is fixed and not scalable.
3fill in blank
hard

Fix the error in the code to correctly add 10 pixels to the margin.

SASS
margin: 20px + [1];
Drag options to blanks, or click blank then click option'
A10
B10px
C10em
D10%
Attempts:
3 left
💡 Hint
Common Mistakes
Adding a number without units to a length with units.
Using a different unit like em which causes unit mismatch.
4fill in blank
hard

Fill both blanks to create a Sass map with font sizes in rem units for small and large text.

SASS
$font-sizes: (small: [1], large: [2]);
Drag options to blanks, or click blank then click option'
A0.875rem
B1.25rem
C1rem
D2rem
Attempts:
3 left
💡 Hint
Common Mistakes
Using px units instead of rem in the map.
Swapping the small and large values.
5fill in blank
hard

Fill all three blanks to create a Sass map that stores widths with different units.

SASS
$widths: (mobile: [1], tablet: [2], desktop: [3]);
Drag options to blanks, or click blank then click option'
A320px
B48rem
C768px
D64rem
Attempts:
3 left
💡 Hint
Common Mistakes
Using rem units for mobile width which is usually fixed in pixels.
Mixing up tablet and desktop widths.