0
0
SASSmarkup~20 mins

Container query preparation in SASS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Container Query Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What does a container query do in CSS?
Which statement best describes the purpose of a container query in CSS?
AIt applies styles based on the size of the element's container, not the viewport.
BIt changes styles depending on the user's screen resolution only.
CIt modifies styles only when the browser window is resized.
DIt applies styles based on the total number of elements inside a container.
Attempts:
2 left
💡 Hint
Think about what 'container' means compared to 'viewport'.
📝 Syntax
intermediate
1:30remaining
Identify the correct container query syntax in Sass
Which Sass code snippet correctly uses a container query to apply styles when the container is at least 30rem wide?
A@container min-width: 30rem { .box { color: blue; } }
B@container (width >= 30rem) { .box { color: blue; } }
C@container (min-width 30rem) { .box { color: blue; } }
D@container (min-width: 30rem) { .box { color: blue; } }
Attempts:
2 left
💡 Hint
Look for the correct parentheses and colon usage.
rendering
advanced
2:00remaining
What color will the box be when container width is 40rem?
Given the Sass code below, what color will the box have if its container is 40rem wide?
SASS
@container (min-width: 50rem) { .box { color: red; } }
@container (min-width: 30rem) { .box { color: green; } }
.box { color: black; }
Agreen
Bblack
Cred
Dno color applied
Attempts:
2 left
💡 Hint
Check which container queries match 40rem width and which style applies last.
selector
advanced
1:30remaining
Which selector correctly targets elements inside a container query?
In Sass, which selector inside a container query will style only direct child

elements of the container?

Ap { font-weight: bold; }
B& p { font-weight: bold; }
C& > p { font-weight: bold; }
D> p { font-weight: bold; }
Attempts:
2 left
💡 Hint
Remember how Sass uses & to refer to the parent selector.
accessibility
expert
2:00remaining
How to ensure container queries do not harm accessibility?
Which practice helps maintain accessibility when using container queries for styling?
AUse container queries to hide important content when container is small.
BEnsure color changes meet contrast standards and do not rely solely on color to convey information.
CApply container queries only to decorative elements without text.
DAvoid using container queries on interactive elements.
Attempts:
2 left
💡 Hint
Think about users with vision impairments and how styles affect readability.