0
0
SASSmarkup~10 mins

Container and wrapper patterns 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 create a container with a max width and center it horizontally.

SASS
.container {
  max-width: [1];
  margin-left: auto;
  margin-right: auto;
}
Drag options to blanks, or click blank then click option'
A100%
B1200px
C50vw
Dauto
Attempts:
3 left
💡 Hint
Common Mistakes
Using 100% for max-width makes the container full width, not limited.
Using 'auto' as max-width is invalid.
2fill in blank
medium

Complete the code to add horizontal padding inside the container for spacing.

SASS
.container {
  padding-left: [1];
  padding-right: [1];
}
Drag options to blanks, or click blank then click option'
A1rem
B0
C10px
D5%
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 removes padding and makes content touch edges.
Using percentages can cause inconsistent spacing.
3fill in blank
hard

Fix the error in the wrapper class to make it a flex container that centers content vertically and horizontally.

SASS
.wrapper {
  display: [1];
  justify-content: center;
  align-items: center;
}
Drag options to blanks, or click blank then click option'
Ablock
Bgrid
Cflex
Dinline
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'block' or 'inline' does not enable flexbox centering.
Using 'grid' requires different properties for centering.
4fill in blank
hard

Fill both blanks to create a responsive wrapper that uses flexbox and wraps items to the next line if needed.

SASS
.wrapper {
  display: [1];
  flex-wrap: [2];
}
Drag options to blanks, or click blank then click option'
Aflex
Bwrap
Cnowrap
Dblock
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'nowrap' prevents items from wrapping.
Using 'block' for display disables flexbox.
5fill in blank
hard

Fill all three blanks to create a container with a max width, horizontal padding, and centered margin.

SASS
.container {
  max-width: [1];
  padding-left: [2];
  margin: 0 [3];
}
Drag options to blanks, or click blank then click option'
A1200px
B1rem
Cauto
D100%
Attempts:
3 left
💡 Hint
Common Mistakes
Using 100% for max-width removes the limit.
Using 0 for padding removes spacing.
Using 0 or fixed values for margin prevents centering.