0
0
CSSmarkup~20 mins

Breakpoints in CSS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Breakpoint Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Breakpoint Usage
Which CSS media query correctly applies styles only when the screen width is between 600px and 900px?
A@media screen and (min-width: 600px) or (max-width: 900px) { /* styles */ }
B@media (max-width: 600px) and (min-width: 900px) { /* styles */ }
C@media (min-width: 600px) and (max-width: 900px) { /* styles */ }
D@media (min-width: 600px), (max-width: 900px) { /* styles */ }
Attempts:
2 left
💡 Hint
Think about how to combine conditions so both must be true at the same time.
📝 Syntax
intermediate
2:00remaining
Identify the Syntax Error in Media Query
What error does this CSS media query produce?
@media screen min-width: 500px) { body { background: blue; } }
CSS
@media screen min-width: 500px) { body { background: blue; } }
ASyntaxError: Missing opening parenthesis before 'min-width'
BSyntaxError: Missing colon after 'screen'
CSyntaxError: Missing opening parenthesis after 'screen'
DNo error, valid syntax
Attempts:
2 left
💡 Hint
Check the parentheses around the condition.
rendering
advanced
2:00remaining
What background color will the box have on a 700px wide screen?
Given this CSS, what background color will the box have if the screen width is exactly 700px?
.box { background: yellow; }
@media (max-width: 600px) { .box { background: red; } }
@media (min-width: 601px) and (max-width: 800px) { .box { background: green; } }
@media (min-width: 801px) { .box { background: blue; } }
CSS
.box { background: yellow; }
@media (max-width: 600px) { .box { background: red; } }
@media (min-width: 601px) and (max-width: 800px) { .box { background: green; } }
@media (min-width: 801px) { .box { background: blue; } }
Ared
Bgreen
Cblue
Dyellow
Attempts:
2 left
💡 Hint
Check which media query matches 700px width.
selector
advanced
2:00remaining
Which media query targets only portrait orientation on screens wider than 480px?
Select the correct media query that applies styles only when the device is in portrait mode and the screen width is greater than 480px.
A@media (orientation: portrait) and (min-width: 481px) { /* styles */ }
B@media (min-width: 481px), (orientation: portrait) { /* styles */ }
C@media (orientation: portrait) or (min-width: 481px) { /* styles */ }
D@media screen and (orientation: portrait) or (min-width: 481px) { /* styles */ }
Attempts:
2 left
💡 Hint
Use 'and' to combine conditions that must both be true.
accessibility
expert
3:00remaining
How to ensure accessible breakpoint changes for screen readers?
When using CSS breakpoints to change layout, which practice best supports screen reader users?
AUse JavaScript to remove hidden content from the DOM at breakpoints to improve screen reader experience.
BUse CSS to visually hide content but keep it accessible by using <code>visibility: hidden</code>.
CUse <code>display: none</code> on content at breakpoints to hide it visually and from screen readers.
DUse only CSS to hide content visually at breakpoints without removing it from the accessibility tree.
Attempts:
2 left
💡 Hint
Think about how screen readers interpret hidden content.