UNIT 10 • STAGE 7 OF 7

Responsive Design & Footer

Make the grid adapt to any screen size, then complete the page with a footer

UNIT
STEP 1

What Are Media Queries?

A media query is a CSS rule that only applies when the browser viewport meets a condition. The most common condition is maximum width: the styles inside only take effect when the screen is at or below a certain pixel size.

The pattern: @media (max-width: 900px) {
  /* These rules only apply on screens 900px wide or less */
  .dancers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

Media queries go at the bottom of your stylesheet, after all other rules. When the browser viewport is wider than 900px, the three-column grid applies. When it narrows to 900px or below, the two-column rule kicks in and overrides it.

This is your first look at media queries. The concept is the same across all projects: write your default styles first, then use @media to adjust them for smaller screens.

Grid changes at each breakpoint:

Wide screen , 3 columns
Tablet , 2 columns
Phone , 1 column
STEP 2

Add Responsive Grid CSS

Add these two media query blocks just above </style>. Media queries always go at the end of your CSS so they can override earlier rules:

馃憠 Add just above </style>: @media (max-width: 900px) {
  .dancers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .dancers-grid {
    grid-template-columns: 1fr;
  }
  #hero {
    padding: 60px 24px;
  }
  #hero h1 {
    font-size: 2rem;
  }
  #dancers {
    padding: 60px 24px;
  }
}

To test the breakpoints, narrow the Live Preview panel by dragging the divider to the left. Watch the grid reflow from three columns to two, then from two to one.

STEP 3

Add Footer CSS

Add these two footer rules after the media queries, still inside <style>:

馃憠 Add after the @media blocks: #site-footer {
  background: #0a0a0f;
  color: rgba(255, 255, 255, 0.45);
  padding: 48px 40px;
  text-align: center;
  font-size: 0.875rem;
  line-height: 2;
}

#site-footer a {
  color: #d4a853;
}
STEP 4

Add Footer HTML

Add the footer element just before </body>, after the modal overlay HTML:

馃憠 Add just before </body>, after the modal HTML: <footer id="site-footer">
  <p>Relentless Feather &middot; Unit 10 &middot; Dancing in Step</p>
  <p>Sources:
    <a href="https://americanindian.si.edu" target="_blank">Smithsonian NMAI</a> &middot;
    <a href="https://whiteearth.com" target="_blank">White Earth Nation</a> &middot;
    <a href="https://mnhs.org" target="_blank">Minnesota Historical Society</a>
  </p>
</footer>

Note on &middot;

&middot; is an HTML entity that renders as a centered dot ( · ), a common separator in footers and metadata lines. You have seen this pattern throughout this unit in the modal nation labels.

STEP 5

Why These Styles?

  • @media (max-width: 900px), the styles inside this block only apply when the viewport is 900 pixels wide or less. On wider screens the rule is completely ignored. Media queries go at the end of the stylesheet so they can override earlier declarations without needing to increase specificity.
  • repeat(2, 1fr) at 900px, switching from three equal columns to two gives each card more width on a tablet. The cards were getting narrow enough to crowd the dancer images at three columns.
  • 1fr at 600px, a single column that fills the full available width is the most readable layout on a phone. Six cards stack vertically, each taking the full row.
  • Reduced padding at 600px, 80px 40px side padding eats significantly into the content area on a narrow phone screen. Reducing to 60px 24px recovers that space without losing the visual breathing room.
  • font-size: 2rem for #hero h1 at 600px, 3rem at that size would push the heading onto multiple lines more than necessary and feel oversized for the viewport.
  • background: #0a0a0f on the footer, slightly darker than the #0f0f1a dancers section, creating a gentle visual step down that signals the end of the page.
  • color: rgba(255, 255, 255, 0.45), muted footer text that stays readable without competing with the main content. Attribution and source links should be present but quiet.

Unit 10 Complete!

You have built a complete, interactive powwow website from a blank page. Hover effects with CSS transitions, illustrated PNG images grounded with object-position, a data-driven modal opened with JavaScript, responsive layout using media queries, and a sourced footer. Every piece connects to a real technique used in production web work.

The content in this unit represents living Tribal traditions. The Jingle Dress dance, the Grass Dance, Men's Traditional, and all of the styles you built cards for are still practiced and celebrated at powwows today across Lakota, Dakota, and Ojibwe communities.

Code Editor
Live Preview