0
0
CSSmarkup~10 mins

Breakpoints in CSS - 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 breakpoint for screens wider than 600px.

CSS
@media (min-width: [1]) {
  body {
    background-color: lightblue;
  }
}
Drag options to blanks, or click blank then click option'
A600px
B400px
C1000px
D300px
Attempts:
3 left
💡 Hint
Common Mistakes
Using max-width instead of min-width
Forgetting to add units like px
Using a value too small or too large
2fill in blank
medium

Complete the code to apply styles only on screens smaller than 768px.

CSS
@media ([1]: 768px) {
  p {
    font-size: 1.2rem;
  }
}
Drag options to blanks, or click blank then click option'
Amin-width
Bheight
Cmax-width
Dwidth
Attempts:
3 left
💡 Hint
Common Mistakes
Using min-width instead of max-width
Omitting units like px
Using unrelated media features like height
3fill in blank
hard

Fix the error in the breakpoint code to target screens between 480px and 1024px.

CSS
@media (min-width: 480px) and ([1]: 1024px) {
  div {
    padding: 2rem;
  }
}
Drag options to blanks, or click blank then click option'
Amax-height
Bmin-height
Cmin-width
Dmax-width
Attempts:
3 left
💡 Hint
Common Mistakes
Using min-width twice
Using height instead of width
Using max-height which targets screen height
4fill in blank
hard

Fill both blanks to create a breakpoint for screens between 320px and 480px wide.

CSS
@media ([1]: 320px) and ([2]: 480px) {
  h1 {
    color: green;
  }
}
Drag options to blanks, or click blank then click option'
Amin-width
Bmax-height
Cmax-width
Dmin-height
Attempts:
3 left
💡 Hint
Common Mistakes
Using height media features instead of width
Reversing min and max
Using the same media feature twice
5fill in blank
hard

Fill all three blanks to create a responsive font size that changes at three breakpoints: 480px, 768px, and 1024px.

CSS
body {
  font-size: 1rem;
}

@media ([1]: 480px) {
  body {
    font-size: 1.2rem;
  }
}

@media ([2]: 768px) {
  body {
    font-size: 1.5rem;
  }
}

@media ([3]: 1024px) {
  body {
    font-size: 1.8rem;
  }
}
Drag options to blanks, or click blank then click option'
Amin-width
Bmax-width
Cmin-height
Dmax-height
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing min-width and max-width incorrectly
Using height media features instead of width
Forgetting units like px