Fluid Type and Spacing — Concept Check
Questions on Fluid Type and Spacing. Scaling type and space continuously with clamp() replaces most sizing breakpoints and removes the jumps where a heading changes size mid-drag.
Questions in this quiz
8 questions on Fluid Type and Spacing — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A developer notices that a heading changes size abruptly when resizing the browser window. What could be a solution to smooth this transition?
- AIncrease the font size in CSS media queries.
- BSet a fixed font size for all screen sizes.
- CUse JavaScript to adjust the font size dynamically.
- DUse clamp() to define fluid sizing for the heading.
2.A webpage uses the following CSS: `h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3.5rem) }`. What happens if the viewport width increases?
- AThe font size jumps directly to 3.5rem.
- BThe font size decreases as the viewport width increases.
- CThe font size increases smoothly within the defined range.
- DThe font size remains constant at 2rem.
3.A designer wants to ensure that a section's padding is appropriate for both mobile and desktop views without using media queries. Which approach should they use?
- ADefine padding using clamp() for fluid spacing.
- BUse media queries to adjust padding for different devices.
- CSet a fixed padding value in pixels.
- DApply padding only using rem units.
4.A developer uses `clamp(2rem, 5vw, 3.5rem)` for font size. What issue might arise?
- AThe font size will be too small on large screens.
- BThe font size will be inconsistent across browsers.
- CThe font size won't respond to user font size settings.
- DThe font size will exceed 3.5rem on large screens.
5.What is the purpose of using a rem term in the clamp() function for font sizing?
- ATo ensure the font size responds to user font size settings.
- BTo decrease the font size on larger screens.
- CTo make the font size larger on smaller screens.
- DTo fix the font size regardless of viewport changes.
6.A webpage has `:root { --space-s: clamp(0.75rem, 0.7rem + 0.25vw, 1rem); }`. What is the benefit of this approach?
- AIt provides fluid spacing that adjusts with viewport size.
- BIt sets a fixed spacing value for all devices.
- CIt only works on desktop devices.
- DIt requires additional media queries for responsiveness.
7.A developer uses `grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr))`. What layout behavior does this achieve?
- AThe grid reflows without breakpoints, adjusting to content size.
- BThe grid requires media queries for responsiveness.
- CThe grid remains fixed regardless of content size.
- DThe grid only works on mobile devices.
8.Why might a developer prefer using clamp() for spacing over traditional media queries?
- AClamp() only works for font sizes, not spacing.
- BClamp() is easier to write than media queries.
- CClamp() provides continuous scaling without abrupt changes.
- DClamp() requires less browser support than media queries.