# Exercise: The Adoption List, Restyled

Turn every list on Paws & Whiskers' Meet the pets page into what it should look like, a menu of buttons in a row, the pets as cards, their tags as pills and the adoption steps as big red numbers, while the tests check each list stays a list.

Apprentice · CSS · Updated November 14, 2026

Paws & Whiskers' "Meet the pets" page has everything it needs except a look. The HTML is right: the menu, the six pets, each pet's tags and the four steps to adopt are all lists, so a screen reader hears "list, 6 items" and can skip from one to the next. But on screen every one of them still looks like the browser's default list: bullets everywhere, everything pushed in from the left, and the steps crammed together. The shelter's volunteers want a row of menu buttons, a card for each pet, rounded tag pills, and adoption steps with big red numbers. The HTML stays exactly as it is; you'll do it all in CSS, and tests check each part as you go.

## Get the exercise code

Open this lesson's GitHub repository, [github.com/ask-codey/exercise-css-adoption-list-restyled](https://github.com/ask-codey/exercise-css-adoption-list-restyled), also linked from the **Exercise** box beside the lesson. Clone it into your `css-in-depth` folder. In a terminal, in that folder:

```bash
git clone https://github.com/ask-codey/exercise-css-adoption-list-restyled.git
```

Git makes a folder, `exercise-css-adoption-list-restyled`, with the exercise code inside.

Then open the folder in VS Code.

The folder holds:

- `index.html`: the Meet the pets page, with its menu, six pets, their tags, the adoption steps and a footer. Ready to use: don't change it.
- `styles.css`: Part 1 is the look (colors, fonts, spacing), ready to use. Part 2 is where your rules go. For you to finish.
- `page.test.js` and `package.json`: the tests that check your rules. You don't need to change these.

## What to do

Open `index.html` with Live Server first, and look at each list the browser drew. Each pet is built like this, in the HTML you were given:

```html
<li class="pet">
  <h2>Biscuit</h2>
  <p>A 3-year-old beagle who loves long walks and knows how to sit for a treat.</p>
  <ul class="tags" role="list">
    <li>Dog</li>
    <li>Good with kids</li>
    <li>Loves walks</li>
  </ul>
</li>
```

Then write your rules in Part 2 of `styles.css`, one part at a time, saving and looking at the page after each:

1. **The menu becomes a row of buttons.** Take the list look off `.site-nav ul`, put its items side by side, and make each link fill its item, with padding all the way around.
2. **The pets become cards.** Take the list look off `.pet-list`, and make each `.pet` a white card with padding and rounded corners, with space between one card and the next.
3. **The tags become pills.** Take the list look off every `.tags` list, and make each tag a pill: side by side, with padding, a background color and fully round ends, and a little room below for when the tags wrap.
4. **The steps keep their numbers.** `.adoption-steps` stays a numbered list, with space between the steps. Make the numbers the shelter's red, `#e63946`, and `1.25rem` big.

Take the list look off each list by its class. A rule for every `ul` and `ol` would take the numbers off the adoption steps too.

## Check your work

Open a terminal in VS Code (**Terminal > New Terminal**) and run `npm install` once, to download what the tests need. After that, run the tests whenever you like:

```bash
npm test
```

At first, the first test passes (the page is already there) and the other nine fail. Each part you finish turns its tests green. A failing test's message says what it found, for example *The pet list (.pet-list) still has the browser's 40px indent on its left. It's padding, so padding: 0 on that list takes it away.*

The tests read your rules, not the screen, so look at the page too, and make the window narrow to watch the tags wrap. The README's checklist says what to look for.

## Hints

- **Bullets gone, but everything still 40 pixels in?** The indent is padding, and it stays when the markers go. *Lists as Containers: Strip the Defaults, Style the Items* takes the whole look away in three lines.
- **Side by side, with padding that pushes.** Two display values put boxes in a line; only one lets their padding push the lines around them. *Lists Side by Side, by Hand* compares them.
- **A small gap between the buttons that you never wrote?** It's the space between the `<li>` tags in the HTML, and it's expected. *Lists Side by Side, by Hand* explains where it comes from.
- **Only the word is clickable?** The padding belongs on the link, and the link needs to fill its item. See *A link that fills its item* in *Lists as Containers*.
- **Space between, not around.** A selector that picks every card right after another card puts the gap only between them (*Combinators: Descendant, Child and Sibling*).
- **Numbers on the list, color on the marker.** `list-style` goes on the `<ol>`, and `::marker` on its items. *Styling a List That Stays a List* shows both, and the shorthand's trap.

## When you're done

Every test is green, and `npm test` prints:

```text
> exercise-css-adoption-list-restyled@1.0.0 test
> node --test

✔ 1) index.html links styles.css, and has the menu, the pets and the adoption steps (1.5526ms)
✔ 2) the menu's list has no bullets, no indent and no margins (28.3641ms)
✔ 3) the menu's items sit side by side, and each link fills its item like a button (4.8133ms)
✔ 4) the pet list has no bullets, no indent and no margins (1.0564ms)
✔ 5) every pet is a card with padding, a background and rounded corners (5.4474ms)
✔ 6) there is space between one card and the next (0.4189ms)
✔ 7) every list of tags has no bullets, no indent and no margins (3.8464ms)
✔ 8) every tag is a pill, side by side with the others, with room below it (10.1826ms)
✔ 9) the adoption steps keep their numbers, with space between the steps (1.7076ms)
✔ 10) the step numbers are the shelter's red, and bigger, with ::marker (0.8247ms)
ℹ tests 10
ℹ suites 0
ℹ pass 10
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 703.2827
```

Your times will differ. Now look back at the page: three of its four lists don't look like lists at all, and all four are still lists in the HTML. If the shelter added a fifth list tomorrow, a list of upcoming adoption days, which of your rules would it pick up by accident? If the answer is "none", every rule you wrote is aimed at one list.

## Submit your exercise

The exercise is how you finish this lesson. When your work is done, put it on GitHub in a repo of your own, then submit that repo's address here. You don't need Git for this: you upload your files in the browser, as the lesson *Put Your Page Online for Free* (Module 1) shows screen by screen.

1. On GitHub, click **+**, then **New repository**. (No account yet? Sign up at github.com: it's free.) Name it (for example `exercise-css-adoption-list-restyled`), choose **Public**, turn **Add README** on so the upload button appears, and click **Create repository**. Your folder's own README replaces GitHub's when you upload it.
2. Choose **Add file**, then **Upload files**. In your exercise folder, select everything (Ctrl+A, or Cmd+A on a Mac), then Ctrl+click (Cmd+click on a Mac) the `node_modules` folder to leave it out, and drag the rest onto the upload area. Drag what's inside the folder, not the folder itself, so `index.html` lands at the top of your repo.

   Why leave out `node_modules`? It isn't your work: it's the nearly two thousand files `npm install` downloaded for the tests, far more than GitHub's upload takes at once, and `npm install` makes it again whenever it's needed.

3. Under **Commit changes**, type a short note, such as *My solution*, and choose **Commit changes**.
4. Paste your repo's address, such as `https://github.com/your-name/exercise-css-adoption-list-restyled`, into **Submit your exercise** on this page. The site checks that the repo is public and holds your commits, and then the lesson is complete.

Changed something after you submitted? Upload the changed files again (each one replaces the file with the same name), commit, and submit again: your latest submission is the one that counts.

## So what

Menus, cards, tags and numbered steps are on nearly every site you'll build, and most of them are lists with the list look taken away. You can now do that on purpose, one list at a time, and keep what a list tells the people who can't see it.

## Key terms

- [Unordered list](https://www.ask-codey.com/glossary/unordered-list)
- [Ordered list](https://www.ask-codey.com/glossary/ordered-list)
- [List style](https://www.ask-codey.com/glossary/list-style)
- [::marker](https://www.ask-codey.com/glossary/marker)
- [Inline-block](https://www.ask-codey.com/glossary/inline-block)

## Related

- [Lists Hold Collections: ul, ol and What the Browser Adds](https://www.ask-codey.com/lessons/css-lists-hold-collections)
- [Styling a List That Stays a List](https://www.ask-codey.com/lessons/css-styling-lists)
- [Lists as Containers: Strip the Defaults, Style the Items](https://www.ask-codey.com/lessons/css-lists-as-containers)
- [Lists Side by Side, by Hand](https://www.ask-codey.com/lessons/css-lists-side-by-side)

Source: https://www.ask-codey.com/lessons/exercise-css-adoption-list-restyled
