Skip to content
Tutorials Center
My learning

Topics

Lesson 134 of 139 ยท Projects

Project: Meet the Team Page

Build a Meet the Team page in four stages with a responsive card grid, hover and focus overlays, touch-friendly fallbacks and social links, using only CSS.

Almost every company site has a "Meet the team" page: a grid of people, each with a name, a role and a way to get in touch. It looks simple, but it hides several useful lessons. The grid has to work from one column on a phone to four on a monitor. The hover overlay must also work for people using a keyboard, and for phones, which have no hover at all.

In this project you build that page for a fictional studio, Lantern Works, in four stages. All the people are made up. To keep the project free of image files, the "photos" are colored circles with initials, drawn entirely with CSS. Each editor contains the complete code so far, and you will use Grid, Position, Transitions and hover and pointer media features.

Stage 1: The markup

A team is a list of people, so use a list: <ul> with one <li> per person. Each person is an <article> with an avatar, a name in a heading, a role, and a small <ul> of links.

The avatar is decorative (the name is right next to it), so it is a <span aria-hidden="true"> with the initials inside. Its color comes from a custom property set in the style attribute, style="--hue: 210", so one CSS rule can color every avatar differently (Custom Properties).

Stage 1: markup with a few base styles

Stage 2: A responsive grid of cards

.people becomes a grid. The recipe repeat(auto-fill, minmax(min(100%, 14rem), 1fr)) creates as many columns of at least 14rem as fit, and shares leftover space equally. No media query is needed (Grid Tracks, Grid Patterns).

Use auto-fill rather than auto-fit if you want a half-empty last row to keep the same card width instead of stretching the cards. Here, with six people, the difference shows on some widths, which is why auto-fill is the better choice for a team page.

The card itself gets a white background, rounded corners and padding. The avatar is a circle made with border-radius: 50%, a fixed width and height, and display: grid; place-items: center for the initials (Centering). The background color uses hsl() with the --hue property, so the one rule gives each person a different tint (Colors).

Stage 2: the card grid

Stage 3: A hover overlay that works for everyone

Now each card gets a short bio that slides up over the card when you hover it. The overlay is a <p class="bio"> positioned with position: absolute; inset: 0 inside the card, which must be position: relative with overflow: hidden to clip the overlay to the rounded corners (Position, Overflow).

Three decisions make this overlay trustworthy:

  1. Keyboard users get it too. .person:hover, .person:focus-within show the overlay, so tabbing to a link inside the card reveals the bio (Pseudo-classes).
  2. Touch devices keep the text visible. Phones have no real hover, so a hover-only bio would be unreachable. The overlay effect is wrapped in @media (hover: hover). On devices that cannot hover, the bio is just a normal paragraph under the role (Pointer and Hover Media Features).
  3. The overlay never hides the links. The links sit above it using position: relative; z-index: 1, so they stay clickable (z-index).

The slide uses transform: translateY() and opacity, the two properties browsers animate smoothly (Transitions). A prefers-reduced-motion block removes the movement for people who ask for less motion.

Stage 3: the overlay

Hover over a card with a mouse, or press Tab to focus a link: the colored bio slides up. In the hover: hover block the .bio rule overrides the plain paragraph styling, and outside it (on touch screens) the bio simply remains a short paragraph in the card.

Stage 4: Polish and the finishing touches

The last stage adds three small details:

  • A lift on hover: transform: translateY(-4px) and a deeper shadow make cards feel tangible.
  • A focus ring for the links with :focus-visible, so the keyboard path is obvious.
  • Heading and intro styling with clamp() for fluid type (Responsive Typography).

Because the avatars use hsl(var(--hue) ...), you can add a seventh person just by choosing a new hue. The CSS never needs to change.

Stage 4: the complete page

Because --hue is set on the .person article in this stage (not on the avatar), both the avatar and the overlay can use it. Custom properties are inherited, so setting one on a parent makes it available to all descendants.

Ideas to take it further

  • Replace the initials with real photos using object-fit: cover on a square <img> (object-fit).
  • Add a filter bar ("Design", "Development") and use :has(:checked) to show only matching cards.
  • Make the grid show a featured first card that spans two columns with grid-column: span 2.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does repeat(auto-fill, minmax(min(100%, 14rem), 1fr)) do?

    auto-fill adds as many tracks as fit, minmax(โ€ฆ, 1fr) shares the extra space, and min(100%, 14rem) prevents overflow on narrow screens.
  2. 2. Why is the overlay wrapped in @media (hover: hover)?

    Designing for hover-capable devices only in a media query keeps content accessible everywhere.
  3. 3. Why add :focus-within next to :hover?

    :focus-within matches an element when any descendant has focus, giving keyboard users the same experience as mouse users.
  4. 4. How does one CSS rule give each avatar a different color?

    Custom properties let data live in the HTML while a single rule turns it into color.

Summary

  • A team is a list: ul of article cards, with decorative avatars hidden from assistive technology.
  • repeat(auto-fill, minmax(min(100%, X), 1fr)) builds a responsive card grid with no media queries.
  • An absolutely positioned overlay needs a position: relative card with overflow: hidden.
  • Pair :hover with :focus-within, and wrap hover-only effects in @media (hover: hover) so touch and keyboard users are not left out.
  • Animate transform and opacity, and respect prefers-reduced-motion.
  • Custom properties such as --hue let one rule style many variations.

Congratulations, that is four more projects done. Next: CSS Cheat Sheet, a one-page summary of the course, followed by exercises and interview questions.