Media Queries, Breakpoints and Container Queries — Concept Check
Questions on Media Queries, Breakpoints and Container Queries. Write mobile-first, choose breakpoints from where your content breaks rather than from device names, and use container queries when a component should respond to its own space.
Questions in this quiz
7 questions on Media Queries, Breakpoints and Container Queries — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A developer notices that a card component in a sidebar looks cramped compared to its appearance in a full-width grid. What should they use to address this issue?
- AIncrease padding inside the card
- BContainer queries for the card component
- CUse a larger breakpoint for the sidebar
- DMedia queries targeting viewport width
2.When designing a responsive layout, why is it recommended to use 'rem' instead of 'px' in media queries?
- A'px' units are deprecated in modern browsers
- B'rem' units are faster to render
- C'rem' units ensure consistent scaling with user font size
- D'rem' units are easier to read
3.A website layout breaks when viewed on a tablet. What is the best approach to fix this issue?
- AAdd a breakpoint based on the tablet's device name
- BUse a media query with a min-width based on content
- CIncrease the base font size
- DSwitch to a desktop-first approach
4.Why might a mobile-first approach be beneficial for performance on mid-range Android devices?
- AIt reduces the number of media queries needed
- BIt simplifies CSS by using max-width queries
- CIt automatically optimizes images for mobile
- DIt ensures the smallest devices do the least work
5.A developer uses a media query to adjust layout for larger screens but notices it doesn't apply to a component inside a narrow container. What might be the issue?
- AThe media query is incorrectly targeting the viewport
- BThe component's CSS is not loaded
- CThe media query is missing a max-width condition
- DThe component requires a container query
6.What is the purpose of using the 'container-type' property in container queries?
- ATo create a containment context for the component
- BTo apply styles based on device orientation
- CTo define the viewport size for the container
- DTo specify the maximum width of the container
7.A developer wants to ensure their website respects user's reduced motion preferences. Which media query should they use?
- A@media (prefers-color-scheme: dark)
- B@media (prefers-reduced-motion: reduce)
- C@media (hover: hover)
- D@media (orientation: landscape)