Problem: Dashboard Widget Layout
Problem description
You have a <div class="dashboard"> containing multiple <div class="widget"> elements. Each widget includes a header and content. Requirements are as follows:
The
dashboardgridshould useauto-fitandminmax(250px, 1fr)to place as manywidgetsper row as fit.Each
.widgetmust declarecontainer-type: sizeso itsheaderfont andpaddingadjust:Below
400pxcontainerinline size:headerfont,1rem, andpadding1.5rem.Between
400px–600px:headerfont,clamp(1rem, 2vw, 1.5rem), andpaddingclamp(1.5rem, 1vw, 2rem).Above
600px:headerfont,1.75rem, andpadding2.25rem.
Within each
widget,contentblocks should maintain a16:9aspect-ratiousing intrinsic sizing, scaling to fill thewidgetwidth.Ensure there isn’t horizontal
overflowat any breakpoint andtransitionsare smooth.
Goal
Implement CSS in styles.css to:
Set up the dashboard grid on
.dashboardusing CSS Grid intrinsic functions.Enable and target nested container queries on
.widgetat the specified thresholds.Apply
clamp()for fluid typography and padding.Enforce
aspect-ratio: 16/9on widget content.
Constraints
Do not modify the HTML structure and use only CSS (no JavaScript is allowed).
Breakpoints are exactly at
400pxand600pxfor container queries.Grid must auto-fit widgets with a minimum width of
250px.Typography and padding must use
clamp()in the medium range.Content must preserve a
16:9aspect ratio using intrinsic sizing.Ensure there isn’t horizontal overflow at any breakpoint.
Apply smooth transitions between states.
Sample visual output
Here’s what the output would look like:
Good luck trying the problem! If you’re unsure how to proceed, check the Solution.
Problem: Dashboard Widget Layout
Problem description
You have a <div class="dashboard"> containing multiple <div class="widget"> elements. Each widget includes a header and content. Requirements are as follows:
The
dashboardgridshould useauto-fitandminmax(250px, 1fr)to place as manywidgetsper row as fit.Each
.widgetmust declarecontainer-type: sizeso itsheaderfont andpaddingadjust:Below
400pxcontainerinline size:headerfont,1rem, andpadding1.5rem.Between
400px–600px:headerfont,clamp(1rem, 2vw, 1.5rem), andpaddingclamp(1.5rem, 1vw, 2rem).Above
600px:headerfont,1.75rem, andpadding2.25rem.
Within each
widget,contentblocks should maintain a16:9aspect-ratiousing intrinsic sizing, scaling to fill thewidgetwidth.Ensure there isn’t horizontal
overflowat any breakpoint andtransitionsare smooth.
Goal
Implement CSS in styles.css to:
Set up the dashboard grid on
.dashboardusing CSS Grid intrinsic functions.Enable and target nested container queries on
.widgetat the specified thresholds.Apply
clamp()for fluid typography and padding.Enforce
aspect-ratio: 16/9on widget content.
Constraints
Do not modify the HTML structure and use only CSS (no JavaScript is allowed).
Breakpoints are exactly at
400pxand600pxfor container queries.Grid must auto-fit widgets with a minimum width of
250px.Typography and padding must use
clamp()in the medium range.Content must preserve a
16:9aspect ratio using intrinsic sizing.Ensure there isn’t horizontal overflow at any breakpoint.
Apply smooth transitions between states.
Sample visual output
Here’s what the output would look like:
Good luck trying the problem! If you’re unsure how to proceed, check the Solution.