Problem: Overlapping Hero and Feature Cards Layout
Problem description
Design a layout with:
A
.herosection spanning full width and overlapping the content area.Four
.cardfeature elements arranged in a 2×2 grid beneath the hero.
Requirements are as follows:
Mobile (<
600px):.herofull width above card stack (single column)Tablet (
600px–900px):.herospanning two columns; cards in a 2×2 grid below, with hero bottom edge overlapping top cards by20pxDesktop (>
900px):.herospanning three columns, cards arranged in a 4-column row and hero overlapping the first row of cards by40px.
Goal
Write CSS in styles.css to set up grid areas, implement overlap with negative margins or transform, use z-index for stacking, and adjust grid-template configurations via media queries.
Constraints
Use CSS Grid for layout and positioning.
No JavaScript is allowed.
Use
z-indexand transform or negative margins for overlap.Set the gap to
16px.Image backgrounds can be simulated with background-color.
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: Overlapping Hero and Feature Cards Layout
Problem description
Design a layout with:
A
.herosection spanning full width and overlapping the content area.Four
.cardfeature elements arranged in a 2×2 grid beneath the hero.
Requirements are as follows:
Mobile (<
600px):.herofull width above card stack (single column)Tablet (
600px–900px):.herospanning two columns; cards in a 2×2 grid below, with hero bottom edge overlapping top cards by20pxDesktop (>
900px):.herospanning three columns, cards arranged in a 4-column row and hero overlapping the first row of cards by40px.
Goal
Write CSS in styles.css to set up grid areas, implement overlap with negative margins or transform, use z-index for stacking, and adjust grid-template configurations via media queries.
Constraints
Use CSS Grid for layout and positioning.
No JavaScript is allowed.
Use
z-indexand transform or negative margins for overlap.Set the gap to
16px.Image backgrounds can be simulated with background-color.
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.